Repository navigation
Conversation
…orage `createTempFile` picked whichever cache dir had more free space, which in practice means external storage on most devices. A crop inherits the original's Exif data, so GPS coordinates and the device serial ended up in a file in a shared location, readable by any app holding `READ_EXTERNAL_STORAGE` on API <= 29, and left there until the next launch cleaned it up. iOS discards Exif on re-encode, so this was Android-only. Write crops to the internal cache dir, keeping external storage as the fallback it already was when there is no internal one. `cleanTask` already sweeps both dirs, so nothing is left behind. Also stop copying the GPS tags: the crop is a new picture the user may share on its own, and it should not carry where the original was taken. The tags that describe how the image was shot, orientation included, are still carried over. (`TAG_GPS_STATUS` was listed twice; both are gone.)
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.
H9: privacy leak. Crops now go to the internal
cacheDirby default, and the 32TAG_GPS_*entries are removed from the set of EXIF tags that get copied.createTempFilepicked whichever cache dir had more free space, which on most devices is external storage. A crop inherits the original's EXIF data, so GPS coordinates and the device serial ended up in a shared location. Any app withREAD_EXTERNAL_STORAGEcould read it on API ≤ 29, and it stayed there until the next launch. iOS drops EXIF when it re-encodes, so only Android had this problem.External storage stays as the fallback when there is no internal cache dir.
cleanTaskalready cleans both dirs. Tags that describe how the image was shot, including orientation, are still copied. (TAG_GPS_STATUSwas listed twice. Both copies are gone.)Follow-up not in this PR: the doc comment in
src/index.tsstill says a downloaded source image may be cached in external storage. That is still true, because it is Fresco's cache and not the crop file.Behavior change
Crops used to land in
externalCacheDiron most devices, and now land in the internalcacheDir. Host apps that pass the returned path to aFileProvider(sharing, uploading through another app) need a<cache-path>entry in their provider XML. With only<external-cache-path>,FileProvider.getUriForFilethrowsIllegalArgumentException: Failed to find configured root. The release notes should mention this.Verification
Not compiled. No
:android:compileDebugKotlinrun and nothing run on a device. The Kotlin was checked for syntax errors only, and the external API signatures were checked against the published artifacts.Split out of #221 (now closed), which bundled six Android fixes in
ImageEditorModuleImpl.kt. Each one can be reviewed and merged separately.