Code Monkey home page Code Monkey logo

Comments (3)

yanickrochon avatar yanickrochon commented on June 6, 2024

For the top, left and width part, I think I get it, now; the values are relative to the current rendered image (responsive), and not the actual image's dimension. This is confusing, and I presumed that onChange, onComplete, etc. had their arguments reversed; where crop was the actual and proportional to the actual image's source dimension, and pixelCrop was the scaled (i.e. responsive) dimension.

This is silly, but since I cannot know in advance the actual rendered size of the element, but I do know the size of the raw image, that crop would've been in relation with the image source, not the responsive image element's dimension...

from react-image-crop.

sekoyo avatar sekoyo commented on June 6, 2024

Crop dimensions are set as percentages - so you just set a crop with a width of 100% and a height of 100% (due to an aspect of 1) - so the crop should be filling the whole image - are you sure that isn't happening? I'm currently travelling so can't test with the values you provided yet.

pixelCrop is an argument in the callbacks for your convenience, giving the crop values converted from percentages to pixels in case you need that, it's not for setting back into the crop prop

from react-image-crop.

yanickrochon avatar yanickrochon commented on June 6, 2024

OOOoooohhh!!!!

That makes sense 😛 I was trying to make sense of the values I got, and couldn't figure it out, I overlooked that possibility. Right, I re-read the docs and it is specified, indeed.

Nothing to see, here!

from react-image-crop.

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.