feat(imagemeta): TIFF-Handler (privates IFD-Tag, ohne Offset-Chirurgie)#78
Merged
Conversation
Sechster Container in der imagemeta-Registry: TIFF. Statt fehleranfaelliger
Offset-Relokation bleiben die Original-Bytes unveraendert (alle bestehenden
Offsets inkl. StripOffsets gueltig): eine Kopie der ersten IFD — ergaenzt um ein
privates Tag (65000) mit der Nutzlast — wird ans Dateiende angehaengt und der
Header darauf umgelenkt. Little- und Big-Endian (II/MM, klassisches TIFF/Magic 42);
BigTIFF (Magic 43) nicht abgedeckt. Replace-Semantik (logisch; verwaiste Bytes
bleiben ungenutzt). Nutzlast inline (<=4 Byte) oder per Offset.
- detect_format erkennt II*\0 / MM\0* -> "tiff"; supported_formats jetzt 6 Formate
- Image._SUFFIX_FORMATS: tif/tiff -> ("TIFF","tiff")
- Tests: LE+BE embed/extract, replace, tiny-inline, absent; Real-Pillow-TIFF im
Cross-Format-Round-Trip. imagemeta.py 311/311 100% (synthetisch, Pillow-frei)
- RFC 0005 + Usage-Guide auf TIFF aktualisiert (von "Zukunft" -> implementiert)
Kanonische CI: 601 passed, 7 skipped, TOTAL 100%; mkdocs --strict gruen.
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Documentation | 2 minor |
| Security | 6 high |
🟢 Metrics 26 complexity · 0 duplication
Metric Results Complexity 26 Duplication 0
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.
Was
Sechster Container in der
imagemeta-Registry: TIFF (LE/BE, klassisches TIFF).TIFF ist offset-basiert (IFD), Einbetten erfordert normalerweise heikle Offset-
Relokation (
StripOffsetsu. a.). Stattdessen: Original-Bytes bleiben unverändert→ eine Kopie der ersten IFD, ergänzt um ein privates Tag (
65000) mit der Nutzlast,wird ans Dateiende angehängt und der Header darauf umgelenkt. So bleiben alle
bestehenden Offsets gültig — keine Offset-Chirurgie.
II/MM, Magic 42); BigTIFF (Magic 43) ist nicht abgedeckt.verwaiste Vorgänger-Bytes bleiben ungenutzt im File (kein Re-Pack).
detect_format→"tiff";supported_formats()jetzt 6 Formate.Image._SUFFIX_FORMATS:tif/tiff→("TIFF", "tiff").Warum diese Strategie
Empirisch verifiziert: nach dem Einbetten liest Pillow das Bild korrekt (Größe/Pixel
erhalten) und toleriert das private Tag; unsere
extractliest die Nutzlast Pillow-frei.StripOffsets bleiben gültig, weil die Originaldaten nicht verschoben werden.
Tests / CI
tests/test_imagemeta.py: LE+BE embed/extract, replace, tiny-inline (≤4 B), absent —alles synthetisch (Pillow-frei) →
imagemeta.py311/311 100 %.tests/test_image.py: Real-Pillow-TIFF im Cross-Format-Round-Trip (einheitliche API).Kanonische CI: 601 passed, 7 skipped, TOTAL 100 %,
mkdocs build --strictgrün.Docs
RFC 0005 + Usage-Guide auf TIFF aktualisiert (Tabellen, §3.2-Detail, Status; TIFF von
„Zukunft" → implementiert; BMP/BigTIFF bleiben als Registry-Erweiterungen offen).