-
Notifications
You must be signed in to change notification settings - Fork 28
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
Local images not cropping properly #16
Comments
I'm having the same issue image getting cropped incorrectly along with |
Hey there! It is possible that the error is not related to local images. The error ( Read about these parameters here https://github.com/react-native-community/react-native-image-editor#cropdata @hossein-zare, can you create a snack that reproduces your problem? Or can you provide me with an image and a piece of code that reproduces this problem? |
Hello, By the way i tried to create an Expo Snack, as usual it didn't work. You can get this image as an example https://unsplash.com/photos/Wi_zzUPm580 It's like that happens when the height of the image is greater than the width, I'm not %100 sure. |
@hossein-zare, @splend-shashank, it seems that the issue appears when the image is large (in your case 4119 x 6068). This issue is only in Android and related to this issue facebook/react-native#22145. As a result, we get the wrong cropping image. Unfortunately, i could not reproduce the I released 4.0.0-beta-0. You can try this version and let me know if the issue is resolved.
You also need to install this library react-native-image-size, because it is now used instead of |
Now it's working fine with normal images, but images taken by the phone camera are cropped incorrectly. the camera image dimensions are There's another minor issue with the PinchGesture and PanGesture, I'll create another issue. |
I am also facing similar issue for photos taken from camera, only when images are larger than 2000x2000. I will try to test 4.0.0 |
It seems that I managed to solve this problem. Try 4.0.0-beta-1
I used several additional libraries. Please see the installing dependencies. If all is well, then I will release version 4. |
Perfect! it works like a charm. |
It works also for me, thank you! Regarding new dependencies - why I wanted to stay away from |
@piotrponikowski, I will try to answer your question. Let's look at the example of this image IMG_0064.JPG This image is vertical, but for some reason the dimensions are horizontal. (what @hossein-zare talked about here). Then you can see an interesting point. We have the same image, but in one case it is local, and in the other it is taken from the server. We look at what we have in
Unfortunately Therefore, I had to use But it turns out everything is not as wonderful as we would like, You can experiment with the It turned out that in this situation, already Therefore, I had to combine both libraries to get the desired result. It seems that I was mistaken in this block. (https://github.com/barrsan/react-native-simple-image-cropper/blob/4.x/src/ImageCropper.tsx#L141) It is enough to use only |
Module If |
@piotrponikowski, you convinced me to abandon I am not strong in Java, but it seems that there is no other choice but to create my own native module that will do prefetch (something like Unfortunately at the moment, I can’t refuse to support remote images. |
I also particularly had some errors in the position of the cropped image being wrong on real devices other than emulated environments working fine, maybe it's a PixelRatio problem or something :'( |
The text was updated successfully, but these errors were encountered: