Coder Social home page Coder Social logo

Comments (5)

ssatriya avatar ssatriya commented on June 7, 2024 1

Just want to let anyone know in case of having this issue, i create .jpeg and it give me fairly small size after crop.

Thanks

from react-advanced-cropper.

Norserium avatar Norserium commented on June 7, 2024

@ssatriya, you can save an image to a special array before you change src. But I'm not sure that I get what you want to achieve.

from react-advanced-cropper.

ssatriya avatar ssatriya commented on June 7, 2024

@Norserium Yap, I already find the solution. In my case just using carousel and dynamically create Ref for each image. With this i think it also easier to perform image editing (like change brightness). Don't know about performance but it works.

Other questions maybe, is it normal to get bigger size after cropping? I tried to 1 mb image and get like 5-6 mb in result after cropped.

from react-advanced-cropper.

Norserium avatar Norserium commented on June 7, 2024

@ssatriya, yes, it's, because it depends on the format that you use when you get a content from canvas: toDataURL, toBlob.

For example:

canvas.toDataURL("image/jpeg");

By default, that methods use image/png and this format doesn't use lossy compression, therefore the result often has larger weight than an uploaded image.

from react-advanced-cropper.

Norserium avatar Norserium commented on June 7, 2024

@ssatriya, you are welcome!

from react-advanced-cropper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.