Uploads: replace exiftool with the built-in exif_stripper #8028
No reviewers
Labels
No labels
AP C2S
AdminAPI
Breaking API
Breaks existing config
Check if still valid
Data Protection
Do not merge
Document in the changelog
Doing
Feature Request / Enhancement
MastoAPI
NL2
NL4
OStatus
OTP Releases
Refactor
Security
To Do
TwitterAPI
bug
complicated
confirmed
deps
discussion
documentation
easy
feature: to be merged in stable
fix: to be merged in stable
incident
needs to be backported to maint
needs-changes
needs-info
needs-review
performance
regression
unclear
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
pleroma/pleroma!8028
Loading…
Reference in a new issue
No description provided.
Delete branch "lambadalambda/pleroma:feature/exif-stripper"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replaces the runtime
exiftooldependency of the upload filters with the pure-Elixir exif_stripper 0.1.3.Exif.StripLocation(lossless GPS stripping for JPEG, PNG, WebP, HEIC/AVIF and TIFF) andExif.ReadDescription.Exiftool,Exiftool.StripLocationandExiftool.ReadDescriptionnames keep working as deprecated aliases, with a startup rewrite and a ConfigDB migration (which leaves configs without:filtersalone).A file with malformed metadata now fails the upload instead of being skipped. This is a rebuilt version of the old
exifbranch on current develop.With 0.1.3, GPS data in XMP (including DJI drone positions) is stripped too, TIFF descriptions are read, and uploads are no longer read fully into memory (about 1 MB extra for a 20 MB image).
/oc review
opencode-agent:job=129:generation=1
Review: replace exiftool with exif_stripper
Merge-readiness: 4/5 — one P2 finding, otherwise solid.
What I checked: the full base-to-head diff (42 files), the pinned
exif_stripper0.1.2 sources (GpsStripper+Description), thePleroma.Upload.Filterpipeline, the ConfigDB migration, the deprecation rewrite, and parity against the old exiftool invocations — including an empirical check that the old-gps:all=invocation also left XMP-embedded GPS in place, so the new library preserving XMP is parity, not a regression.P2 findings
P2:
Exif.ReadDescriptionsilently drops TIFF descriptions (regression vs exiftool)image/tiffpasses the"image" <> _gate inlib/pleroma/upload/filter/exif/read_description.ex, so the file reaches the library.ExifStripper.Description.read_binary/2only matches JPEG, PNG, WebP, GIF and ISO-BMFF magic — TIFF (II*\0/MM\0*) falls through to the catch-all[], returnsnil, and the filter reports{:ok, :noop}. TIFF uploads lose description prefill with no log or other signal. NoteStripLocationdoes handle TIFF, so only the read side is affected.exif_ascii_taglookup as the other containers) in exif_stripper, or document that TIFF descriptions are no longer read.No P0/P1 findings. The fail-closed behavior on malformed metadata is disclosed in the PR description and is a deliberate trade-off; the deprecated alias modules, the startup rewrite (with dedup), the ConfigDB migration (leaves filter-less configs alone), and the byte-identical
:nooppath all check out. SVG/GIF resolve to:noopvia the library catch-all, and PNG text-chunk removal matches the old-png:all=behavior./oc review
opencode-agent:job=135:generation=1
Review: replace exiftool with exif_stripper
Merge-readiness: 5/5 — no findings. Production-ready as reviewed.
What I checked: the complete PR diff (44 files, merge-base to head), the pinned
exif_stripper0.1.3 sources (GpsStripper+Description), thePleroma.Upload.Filterpipeline semantics, the ConfigDB migration, the deprecation rewrite, and parity against the old exiftool invocations. Empirically: compiled the tree cleanly and ran the full exif-related suite — the 23Exif.*/Exiftoolfilter tests plus the migration, deprecation-warning, and instance-generator tests (28 tests) — all pass. I also verified a TIFFImageDescriptionround-trips through the new read path, confirming the P2 from the previous review (TIFF descriptions dropped under 0.1.2) is fixed by the 0.1.3 bump and is not re-raised.Spot-checks that held up:
StripLocationstrips GPS from JPEG, PNG, WebP, TIFF, and both HEIC variants (gridded included), patches same-file inputs in place only after the full patch plan is computed (with an overlapping-patch safety net), and uses temp-file + rename with mode preservation for rebuilds (PNG). Other EXIF data is preserved; no re-encoding.ReadDescriptionenforces the description limit and blank-value rules in the library, returns:noop(not a nil:filtered) when nothing is found, and never raises on missing files — the pipeline treats it identically to the old flow.Exiftool*names delegate to the new filters (the bareExiftoolalias is new and covers configs the old startup check already referenced); the startup rewrite dedups collisions and the migration leaves filter-less configs untouched.No P0/P1/P2 findings. The previously reported TIFF-description gap is addressed in the current code.