react-native-image-crop-picker
react-native-image-crop-picker copied to clipboard
GPS info in EXIF data not availabe when image is picked using Google Photos
Version
Tell us which versions you are using:
- "react-native-image-crop-picker": "^0.30.0",
- "react-native": "0.64.1"
Platform
- Android
when selecting an image using openPicker method, if the user picks the image through Google Photos, the GPS information in the EXIF data is not available.
if the user picks the same image from Gallery or Recents, GPS data is available.
this is the code i use to pick the image:
import ImagePicker from 'react-native-image-crop-picker';
const ph = await ImagePicker.openPicker({
multiple: true,
includeExif: true,
includeBase64: true,
width: 640,
height: 480,
mediaType: 'photo',
compressImageMaxWidth: 640,
compressImageMaxHeight: 480,
compressImageQuality: 0.3,
maxFiles: 40
});
for (let i = 0; i < ph.length; i++) {
const image = ph[i];
console.log( JSON.stringify(image.exif));
}
when i pick the image using gallery, i get the following exif data:
{
"SubSecTimeDigitized":"127",
"Orientation":"1",
"DateTimeDigitized":"2022:06:26 01:30:19",
"GPSProcessingMethod":null,
"Model":"sdk_gphone_x86",
"Make":"Google",
"ISOSpeedRatings":"100",
"ImageWidth":"960",
"SubSecTime":"127",
"GPSLongitude":"122/1, 5/1, 223/100",
"ImageLength":"1280",
"WhiteBalance":"0",
"GPSTimeStamp":"22:29:57",
"ExposureTime":"0.01",
"FocalLength":"5000/1000",
"GPSLatitudeRef":"N",
"GPSDateStamp":"2022:06:25",
"GPSAltitudeRef":null,
"GPSLatitude":"37/1, 25/1, 2432/100",
"SubSecTimeOriginal":"127",
"GPSLongitudeRef":"W",
"DateTime":"2022:06:26 01:30:19",
"GPSAltitude":null,
"Flash":"0",
"FNumber":"2.8"}
when i pick the very same image using Google Photos, out put is as follows:
{
"SubSecTimeDigitized":"755",
"Orientation":"1",
"DateTimeDigitized":"2022:06:26 01:30:19",
"GPSProcessingMethod":null,
"Model":"sdk_gphone_x86",
"Make":"Google",
"ISOSpeedRatings":"100",
"ImageWidth":"960",
"SubSecTime":"755",
"GPSLongitude":"0/1, 0/1, 0/1",
"ImageLength":"1280",
"WhiteBalance":"0",
"GPSTimeStamp":"00:00:00",
"ExposureTime":"0.01",
"FocalLength":"5000/1000",
"GPSLatitudeRef":"",
"GPSDateStamp":"",
"GPSAltitudeRef":null,
"GPSLatitude":"0/1, 0/1, 0/1",
"SubSecTimeOriginal":"755",
"GPSLongitudeRef":"",
"DateTime":"2022:06:26 01:30:19",
"GPSAltitude":null,
"Flash":"0",
"FNumber":"2.8"}
as seen, all GPS info (longitude, latitude, reference) are wiped off.
so far, this happened in a pixel device with API 30 and android version 11.
i tried it in Samsung with android 9 and pixel with android 8. it did not happen in those devices.
it is most probably related to android 11.
any help will be appreciated