react-native-image-crop-picker icon indicating copy to clipboard operation
react-native-image-crop-picker copied to clipboard

Image quality degraded when `freeStyleCropEnabled: true` in non-development builds

Open Maker-Mark opened this issue 2 years ago • 6 comments

Version

Tell us which versions you are using:

  • react-native-image-crop-picker v0.39.0
  • react-native v0.71.1

Platform

Tell us to which platform this issue is related

  • iOS
  • Android

Expected behaviour

  • Cropped images are captured with high quality, so that text is readable.

Actual behaviour

  • The image is downscaled and the text becomes hard to read.

Steps to reproduce

  1. Set freeStyleCropEnabled: true for ImageCropPicker.openCamera or ImageCropPicker.openPicker. Note: Don't set a manual height and width in the options. That seems to be a workaround, but cannot be accepted as a solution, since images should not be downscaled just because they were cropped. If anything they should have higher fidelity, since it's potentially zoomed in.

  2. IMPORTANT: Create a testflight build of your app, this issue was only occurred when the app is archived and not running in development. I confirmed this many many times, the behavior is odd, and makes this issue particularly sneaky.

  3. "Choose" the image, and display it in an image tag. Additionally/alternatively, upload the image returned from the picker to a aws bucket or similar, and view the image.

  4. Notice the terrible image degradation

Attachments

Resulting image quality following steps to reproduce without workaround

Resulting image using the workaround setting the height/width to a static number (ie 1000 for each). with workaround using height:width set

// stacktrace or any other useful debug info

Love react-native-image-crop-picker? Please consider supporting our collective: 👉 https://opencollective.com/react-native-image-crop-picker/donate

Maker-Mark avatar Nov 21 '23 15:11 Maker-Mark

@ivpusic Can you take a look at this and provide insight why this issue could be for non-development only, and how this can be fixed? This is a huge issue. Users would crop a image with text that was clearly readable, but when they choose the image they loose the ability to read the text due to the downscaling.

Maker-Mark avatar Nov 21 '23 15:11 Maker-Mark

Currently experiencing the same issue on version 40.0. If you do not set a static height and width, the image defaults to a max of 200x200.

lkarper avatar Dec 12 '23 13:12 lkarper

@Maker-Mark I was able to fix this issue using the code in this PR: https://github.com/ivpusic/react-native-image-crop-picker/pull/1500

lkarper avatar Dec 14 '23 15:12 lkarper

@lkarper Nice, do you have a patch for this ready? If not, I can throw one together and add it here.

Maker-Mark avatar Dec 15 '23 16:12 Maker-Mark