Open iamnotreddy opened 3 months ago
Hm well maybe it just doesn't have the replacement data at this point yet. It's definitely in the file, so if you read it you will get GPS metadata.
Also on Android there's no way to get that metadata currently - which sucks. So this is not really a public API at all.
@mrousavy - appreciate you getting back to me!
just to clarify, are referring to reading the GPS metadata from this photo file? my original understanding was that I could read the GPS metadata from the photo metadata so that might make sense why I'm not seeing it
@iamnotreddy I also don't see the GPS data if I console.log
the camera.takePhoto
output. However, @mrousavy is right and the data is contained in the file metadata. https://github.com/francisco-sanchez-molina/react-native-exif can read that data and the values are correct in my case, at least on the latest iOS using iPhone 13.
Thanks for confirming on the takePhoto
output @aesqe! That makes sense, I will try to get the GPS tag from the file metadata
Question
I'm trying to access the GPS metadata from the photo metadata property but am unable to locate it. My understanding is that it should appear in the metadata object in a property called
'{GPS}'
.I went into the native code and I was able to log the expected GPS metadata, so I'm unsure if this is an actual issue or just something I'm doing wrong so I'll post my findings. Curious if anyone else has run into these issues with accessing GPS metadata and / or figured a way to resolve it.
When I log the metadata property from the photo inside react native:
I don't see the GPS metadata tag (removed some fields for brevity):
I went into the native code and I was able to log the GPS data inside the
MetadataProvider
file. This is what itsreplacementMetadata
function returns (also abridged some fields):The GPS data above appears to be correct and is what I would hope to see inside the photo metadata. This also makes me think it's not a location permissions issue on my end.
Something else I noticed in the native code: when I log
photo.metadata
inside thephotoOutput
function insidePhotoCaptureDelegate
file, the GPS tag does NOT appear (but I see EXIF, TIFF etc.).I don't have too much understanding of the native code and how it all ties together but hoping this information is helpful. Please let me know if any additional context is needed from my side.
What I tried
I've ensured the following:
enableLocation
is set to true in the<Camera>
componentNSLocationWhenInUseUsageDescription
toInfo.plist
hasPermission
is true from theuseLocationPermission
hookVisionCamera Version
4.0.5
Additional information