Open dancherb opened 6 years ago
@ivpusic @nico1510
I'm also having this problem -- I see GPS data when uploading from the camera roll (with exif option enabled), but no GPS data when uploading right from the ImagePicker camera. @dancherb is this similar to the issue you are having?
same here, any progress?
@BigPun86 @drewandre @dancherb I also found this issue, any idea to handle this?
@haifahrul I didn't find a solution, no.
met too
Any progress on this ?
any news? would be very usefull
any updates on this?
@sam17896 @gino8080 @dcoellarb @lighthx @drewandre This is how i converted it to latitude and longitude.
const convertDMSToDD = function (degrees, minutes, seconds, direction) {
var dd = degrees + minutes / 60 + seconds / 3600;
if (direction == "S" || direction == "W") {
dd = dd * -1;
}
return dd;
};
if (item.exif) {
let latitude =
item.exif.GPSLatitude ||
(item.exif["{GPS}"] && item.exif["{GPS}"].Latitude);
let longitude =
item.exif.GPSLongitude ||
(item.exif["{GPS}"] && item.exif["{GPS}"].Longitude);
if (latitude && longitude) {
if (
latitude.toString().includes("/") ||
latitude.toString().includes(",")
) {
let splittedLatitude = latitude.split(",").map((d) => eval(d));
let splittedLongitude = longitude.split(",").map((d) => eval(d));
if (
splittedLatitude &&
splittedLatitude.length &&
splittedLongitude &&
splittedLongitude.length
) {
let finalLatitude = convertDMSToDD(
...splittedLatitude,
item.exif.GPSLatitudeRef
);
let finalLongitude = convertDMSToDD(
...splittedLongitude,
item.exif.GPSLongitudeRef
);
if (finalLatitude && finalLongitude) {
let selectedLocation = {
lat: finalLatitude,
lng: finalLongitude,
};
console.log(selectedLocation);
}
}
}
}
}`
We're not getting any GPS info on iO using "react-native-image-crop-picker": "^0.36.0" and "react-native": "0.63.4"
I think iOS has a new method to pick a photo using PHPicker. See this blog: https://www.felixlarsen.com/blog/photo-metadata-phpickerview and assuming that location permission is on then we should be able to get the EXIF metadata
Any ideas how to get this working on IOS
I think I've solved this. If you disable cropping, you will get the GPS info. After looking at the code, I've realized that cropping creates a new image which does not include the GPS info.
even when cropping is off on v0.37.3 and rn v0.67.4 the gps location is missing on IOS any solution?
The Geolocation data is there on iOS, it just sits under a different property:
{
"creationDate": "1670047414",
...
"exif": {
...
"{Exif}": {
...
},
"{GPS}": {
"Altitude": 2.3358781324002402,
...
"Latitude": 37.87813833333333,
"LatitudeRef": "S",
"Longitude": 144.81051666666667,
"LongitudeRef": "E",
"Speed": 0.6834079021992564,
"SpeedRef": "K",
"TimeStamp": "00:00:00"
},
...
},
"filename": "IMG_0007.JPG",
...
}
Geolocation data for the same image on Android:
{
"exif": {
"DateTime": "2022:12:03 17:03:33",
...
"GPSAltitude": "66089/28293",
"GPSAltitudeRef": "0",
"GPSDateStamp": "2.2.0.0.",
"GPSLatitude": "37/1,52/1,413/10",
"GPSLatitudeRef": "S",
"GPSLongitude": "144/1,48/1,1893/50",
"GPSLongitudeRef": "E",
"GPSProcessingMethod": null,
"GPSTimeStamp": "00:00:00",
...
"Latitude": -37.87813949584961,
"Longitude": 144.81051635742188,
...
},
"path": "file:///data/user/0/com.trailnavigator.android/cache/react-native-image-crop-picker/IMG_5511.jpg",
...
}
This pull request should fix it: https://github.com/ivpusic/react-native-image-crop-picker/pull/1882
RN 0.55.3 react-native-image-crop-picker 0.20.3
On Android I receive an exif data object that includes the following:
On iOS, when trying the same images and freshly taken ones (that work with another module, react-native-image-picker), no geolocation data is returned.