ivpusic / react-native-image-crop-picker

iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping
MIT License
6.09k stars 1.55k forks source link

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

Open Maker-Mark opened 10 months ago

Maker-Mark commented 10 months ago

Version

Tell us which versions you are using:

Platform

Tell us to which platform this issue is related

Expected behaviour

Actual behaviour

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 commented 10 months ago

@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.

lkarper commented 9 months ago

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 commented 9 months ago

@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

Maker-Mark commented 9 months ago

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