iosreact-nativestorageimage-compressioncamera-roll

React Native, storing images in users gallery without compression


I am developing an App that verifies images based on their hash. I hash the images using this library "react-native-fetch-blob".

I store all the images taken inside the app, I am trying to allow users to be able to share the original uncompressed image.

Problem: When using React-Native Camera roll or React native Share to save the image to my local gallery, compression is performed which changes the hash of the image if I recalculate it.

What I want to do, is to be able to save the image to the users local gallery without compressing the photo?

Any help would be very appreciated. :)

I have run tests retrieving the photos back into the app (from the user's normal gallery) using React-Native-Image-Picker; However, I believe that also forms some compression on the image. I have also used react-native-fetch-blob to copy the photo from the user photo gallery back into the app.

Can provide code I used to generate the below results if anyone needs that.

Hash Results - from Image Picker

camera roll save 10c30a42ead3636a8fd8cfd1eb6952db9f8bbb97fbbdccf96060b67f27be0766 fileSize: 591635,

React-Native share save image cf799ba599e65a42905cb25fabc0150286ee923113da2af21ad7bb2a650bb86d fileSize: 603288

Expected Hash0802368f14296c4d6750a4fc853cda68de67b8e31adf16f38b0eabb7e8b28d0a

Thanks Again


Solution

  • Solved issue on react-native-camera-roll. Issue was stripping of meta-data on IOS side. https://github.com/react-native-community/react-native-cameraroll/issues/125