-
-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some photos have gps, some photos don't. #177
Comments
Hi! That's unfortunately how it is. Not all photos get a location recorded. My experience is that it's actually quite common that photos are missing GPS values. If you don't think this is the reason and you have a photo that has GPS in another Exif parser but not in ExifReader, please provide an example file and I'll have a look. Exiftool is a good program to check in. Here is an online version: http://exif.regex.info/exif.cgi |
@mattiasw i try it on http://exif.regex.info/exif.cgi and even on your website https://mattiasw.github.io/ExifReader/amd/ |
That is weird. 🤔 Could it have something to do with React Native again? That the phone removes the location before using the photo or something. I've read that e.g. Iphone does that when uploading to a web site but not sure if it's the same in React Native. https://apple.stackexchange.com/questions/326789/gps-exif-from-iphone-photo-upload-in-safari |
When selecting images from the photo gallery on iOS I am able to get the EXIF data if I use another library that has native functionality. Search "includeExif" and you can see where it gets the exif data from the selected images. However, with ExifReader I am not able to get the same EXIF data. |
base64ImageIos.txt When using the react-native-image-crop-picker here is what the EXIF data returned looks like. Notice it has lat/long/altitude When using this library I do not get any of that information in the exif response. EDIT: I don't think the issue has anything to do with your library, I believe there is some gypsy magic happening to obtain the EXIF data natively and it's not copying that to the output file. |
When searching the web regarding this I saw a lot of people having trouble getting the location data using regular Exif libraries and React Native. I think you're on to something here @tomgreco, you may have to use a native implementation to be able to read the location data from a photo. That's a bit sad if it's true but not much we can do about it I guess. Would be nice to know for sure though. |
This issue is really a pain. Yes as @mattiasw say, using native solution it'll work, but there is some information I think it'll help (spend my whole day to found it 😢 ). Using native solution with work on iOS and Android which have In Android with SDK >= 29, you need this permission:
Don't forget to request for this permission before you try to pick and read EXIF. That's it, but...It's somehow funny that, on some device with different build of Android (Nokia, Samsung, Pixel...). Even with sdk > 29, you still can read EXIF easily without Hope it help. Read more here |
Thank you for your research into this @kyoz! I know other developers will appreciate the time you put into this. |
Thanks @mattiasw for great plugin. One more thing I just found out is that, also this permission is sensitive, but if you already granted permission for these (which we usually use to read and write image, mean scoped storage):
It will grant you |
I'm closing this since it seems there's not much to do for this library. But please keep commenting if anything new comes up. This discussion is linked from the README so people can find it. |
they were all taken from the same camera
one photo
another photo
what's wrong with me?
here is my code:
The text was updated successfully, but these errors were encountered: