ivpusic / react-native-image-crop-picker

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

Cropping png yields white bg #1366

Closed jordangrant closed 2 years ago

jordangrant commented 3 years ago

Version

Tell us which versions you are using:

Platform

Tell us to which platform this issue is related

Expected behaviour

Cropping a png returns another png

Actual behaviour

cropping png fills the transparent layer with a white bg

Steps to reproduce

  1. feed ImagePicker.openCropper a remote uri to a png

  2. crop

Attachments

// 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

jordangrant commented 3 years ago

Similar to https://github.com/ivpusic/react-native-image-crop-picker/issues/1026

mahcloud commented 3 years ago

@jordangrant I feel like I must be missing something. When I use the circular cropper the base64 image is a square with white background around my circular image. Is this expected?

jordangrant commented 3 years ago

@mahcloud I want to preserve a transparent background.

mahcloud commented 3 years ago

@jordangrant but it comes back as a jpeg. It can't be transparent as a jpeg, right? I'm seeing

"mime": "image/jpeg"
mahcloud commented 3 years ago

@jordangrant thanks for responding so quickly, btw

jordangrant commented 3 years ago

@mahcloud That's correct. Here's a video https://youtu.be/DyBPipfPk4M

mahcloud commented 3 years ago

@jordangrant I think I see the confusion. We are using the cropperCircleOverlay setting. If we use the square cropper and then manually style after, it works fine. We just really like the circular cropper UI for our customer, but we will have to stop using it if it provides white background.

truongduyng commented 3 years ago

black background for android. Why not preserve png format and transparent background?

lsdimagine commented 2 years ago

Any plan to fix it?

jordangrant commented 2 years ago

Any plan to fix it?

Solved here https://github.com/callstack/react-native-image-editor/issues/37#issuecomment-694710262