Repository navigation
Keep capture GPS out of iOS photos unless includeLocation is set - #13
Merged
Merged
Conversation
Since #6 the camera delegate copies the picker's media metadata into the saved JPEG and reads coordinates from it for the PhotoTaken payload. If the app already has location permission for another reason, that metadata can contain a GPS dictionary, which then ended up in the file and the event even with includeLocation false. Strip the GPS dictionary before writing when the caller hasn't opted in, and only add latitude/longitude to the payload when they have. The README now says this explicitly for iOS camera captures. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
simonhamp
added a commit
to sonalidudhia/mobile-camera
that referenced
this pull request
Oct 22, 2026
NativePHP#17 landed on main with a smaller version of this fix, so the three picker call sites conflicted. This keeps CameraPresenter and drops NativePHP#17's topViewController helper, because CameraPresenter also waits for a sheet that is still closing before it presents. Everything else from main, including NativePHP#13, comes through unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #6.
The iOS camera delegate now writes the picker's
mediaMetadatainto the saved JPEG so Exif survives. Only the synthesised GPS was gated onincludeLocation. If the capture metadata already had a GPS dictionary, because the app holds location permission for some other reason, it went into the file and into thePhotoTakenpayload without the caller opting in. Before #6 the file was re-encoded from a bareUIImage, so it never had location.Changes:
includeLocationis false, the GPS dictionary is removed from the properties before the JPEG is written. The rest of the Exif is kept, sotakenAtstill works.finishPhototakes the flag and only setslatitude/longitudewhen it's true.I only parse-checked the Swift (
swiftc -parse) and haven't run it on a device. Worth testing a capture withincludeLocationoff in an app that already has location permission, then confirming the file has no GPS tags and the event has no coordinates.🤖 Generated with Claude Code