hhunaid / react-native-image-crop-tools

Native-ish Image Crop Tools for react native
171 stars 58 forks source link

[Android] `width` and `height` returned by `onImageCrop` are swapped for EXIF-rotated pictures. #66

Open StampixSMO opened 2 years ago

StampixSMO commented 2 years ago

The width and height parameters passed to onImageCrop are the inverse of the actual image dimensions for the image located at parameter uri.

This only happens for EXIF-rotated pictures, (e.g. Orientation: 6). The Canhub library properly resets the Orientation value to 0 and updates ImageWidth and ImageHeight in the EXIF headers, but by using the dimensions of cropRect here, the returned width and height are wrong.

This breaks some stuff on my side, since I'm relying on those 2 parameters to do some extra processing.

PS: Any way to preserve EXIF aside from Orientation? All the other metadata in there are stripped as well, unfortunately.