react-native-image-base64 icon indicating copy to clipboard operation
react-native-image-base64 copied to clipboard

may not support image png conversion base64

Open MrZhang123 opened this issue 7 years ago • 5 comments
trafficstars

I conversion .png to base64 , when i decoding base64 to png , the background is black

MrZhang123 avatar Mar 29 '18 03:03 MrZhang123

That's possible, we mainly designed this lib to send camera pictures which are JPEG so we didn't focus on PNG.

I add it to the roadmap, in the meantime feel free to PR :)

Michaelvilleneuve avatar Mar 29 '18 05:03 Michaelvilleneuve

That's possible, we mainly designed this lib to send camera pictures which are JPEG so we didn't focus on PNG.

I add it to the roadmap, in the meantime feel free to PR :)

any news on it?

Desintegrator avatar Mar 30 '20 07:03 Desintegrator

@Desintegrator did you find any way to remove the dark background in image?

kirantripathi avatar Apr 15 '20 12:04 kirantripathi

@Desintegrator did you find any way to remove the dark background in image?

@kirantripathi yes, its works correctly in ios without any changes and for android you need to open RNImgToBase64Module.java in lib sources and change single line in "bitmapToBase64" method bitmap.compress(Bitmap.CompressFormat.JPEG, 80, byteArrayOutputStream); to bitmap.compress(Bitmap.CompressFormat.PNG, 80, byteArrayOutputStream);

Desintegrator avatar Apr 15 '20 12:04 Desintegrator

@Desintegrator did you find any way to remove the dark background in image?

@kirantripathi yes, its works correctly in ios without any changes and for android you need to open RNImgToBase64Module.java in lib sources and change single line in "bitmapToBase64" method bitmap.compress(Bitmap.CompressFormat.JPEG, 80, byteArrayOutputStream); to bitmap.compress(Bitmap.CompressFormat.PNG, 80, byteArrayOutputStream);

@Desintegrator thank you for your help.

kirantripathi avatar Apr 27 '20 08:04 kirantripathi