Pixel coords for the image crop
See original GitHub issueApparently the additional parameter pixelCrop
of onChangeComplete
is always undefined
.
And also, is there any way to set the crop on pixel units? Instead of converting it from pixel units to percentage every time in order to use it?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How to crop an image using x/y/r pixel coords? - Stack Overflow
I'm trying to develop some code to crop multiple areas within an image. The only info I have is the x/y pixel coordinates...
Read more >Transformation - Basic Image Manipulation - CodinGame
Let's start with a very simple operation: cropping. Cropping is the action to cut a part of the image to reframe it. In...
Read more >Using rasterio to crop image using pixel coordinates instead of ...
So, is there any way I can crop the worldview3 image using rasterio but using pixel coordinates instead of geographic coordinates so that...
Read more >Crop images with ImageContainer - Squidpy - Read the Docs
This example shows how crop images from squidpy.im. ... You can specify the crop coordinates in pixels (as int ) or in percentage...
Read more >Module: Crop - cloudfront.net
Left and right rectangle positions · Absolute: Specify these values as absolute pixel coordinates in the original image. For instance, you might enter...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Doing this is really easy. Here’s how my component looks:
Get the base64 of a file object, render it to an image, get the height and width. Then, pass the height and width to your cropper props, something like this:
Now you have percentages from pixels, for anyone else who needs it 😃
Getting naturalWidth and naturalHeight as 0, any idea why?