-
-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to make the crop pan to always fit the height and width on the image. #512
Comments
Either you have to set the cropper aspect ratio to the same value as the image one or you should use the |
This is my code but the crop pan , do not fit with the height and width of the image show inside div. Would you please help me to resolve this one. |
Please provide a CodeSandbox showing your issue. It's hard to understand with just words 😅 |
https://codesandbox.io/p/sandbox/stupefied-haibt-rfgm9h?file=%2Fsrc%2Findex.js%3A24%2C13 this is the case senerio, image should be object-contained, height width could be different, |
Ops! sorry for that. |
If I understand correctly what you want, you should set the cropper aspect ratio to the same value as the image one. |
Closing as there was no answer for a while. Comment to re-open 😉 |
I have similar issues, I cant set the (max) cropSize to the image's size. |
I really recommend using the |
I tried that as well(aspect set to 15/11, container div's aspectRatio as well), not helped. Also, I need to cut the image pixel perfect. |
Do you need a sample app for reproduction? |
Yes definitely, this would help |
I think the problem is, there is no possibility to keep the image size the same 1-1px mapping with zoom=1. The image will always squeezed. I have tried without cover param, the default is "cover". |
I got it now, and find logically strange to use the cropSize prop relative to bounding div`s size. |
That's why I don't like the The pixels size shouldn't matter in the crop UI: it only matters when actually cropping the image to produce the new image. |
I came to handle cropSize in this way:
|
I have images with different height and width. Some images are too small and some are with large height and i have to show images in "contain" mode.
How to make the cropper pan always fit the image height and width.
I tried different aspect ratios but it does not worked.
The text was updated successfully, but these errors were encountered: