[
https://issues.apache.org/jira/browse/TIKA-4824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18106051#comment-18106051
]
ASF GitHub Bot commented on TIKA-4824:
--------------------------------------
dschmidt commented on PR #3037:
URL: https://github.com/apache/tika/pull/3037#issuecomment-5347422631
Thanks! All addressed in b980445fc3:
1. CHANGES now spells out the detection + thumbnail-attachment change
downstream inherits, and moved to a 4.1.0 section.
2. Each IFD entry table and out-of-line value block is read once into a
`byte[]` instead of a syscall per byte.
3. Config is now read per-request from the `ParseContext` (PDFParser
convention, constructor config as fallback).
4. Dropped the little-endian BigTIFF `image/tiff` magic; named BigTIFF DNGs
still resolve by name+data, and proper `.tif` BigTIFF handling can follow once
TiffParser can read BigTIFF.
5. Added a two-IFD same-offset fixture proving the preview de-dup.
Also adopted your shared `FileChannel` snippet. The `MimeTypes.forName`
unbounded-map growth predates this PR, so I'll file it separately.
> Extract embedded JPEG previews from TIFF-based raw images (NEF, ARW, PEF,
> DNG, CR2)
> -----------------------------------------------------------------------------------
>
> Key: TIKA-4824
> URL: https://issues.apache.org/jira/browse/TIKA-4824
> Project: Tika
> Issue Type: New Feature
> Reporter: Dominik Schmidt
> Priority: Major
>
> TIFF-based camera raw files embed camera-generated JPEG previews, often at
> full resolution. Tika currently gives no access to them: the x-raw-* types
> are glob-only (not sub-classes of image/tiff), no parser claims them, and
> nothing extracts the preview bytes. For consumers that cannot decode raw
> sensor data, the embedded JPEG is the only practical way to render a raw file
> (analogous to TIKA-4801 for audio cover art).
> The previews are stored in two ways:
> - Nikon NEF/NRW, Sony ARW/SRF/SR2, Pentax PEF/PTX:
> JPEGInterchangeFormat/-Length tags in the IFD chain or in SubIFDs
> - Adobe DNG, Canon CR2: a single JPEG-compressed strip (Compression 6/7)
> Proposal:
> - New RawTiffParser in tika-parser-image-module claiming
> image/x-raw-{nikon,sony,pentax,adobe} and image/x-canon-cr2: TIFF/EXIF/XMP
> metadata via TiffParser, walks the IFD chain plus SubIFDs and emits each
> preview through the EmbeddedDocumentExtractor (image/jpeg, THUMBNAIL);
> configurable via "raw-tiff-parser": {"extractPreviews": false}
> - Strip candidates need a safety rule: raw sensor data in CR2/DNG is lossless
> JPEG and also starts with an SOI marker. Strips are only accepted for
> displayable images (PhotometricInterpretation RGB/YCbCr, or 8 bits per sample
> when it is absent, as in CR2's preview IFD)
> - Make image/x-raw-{nikon,sony,pentax,adobe} sub-classes of image/tiff so
> name+data detection resolves them (they have no reliable magic; data-only
> detection stays image/tiff)
> - Synthetic ~2KB test fixtures mirroring the real IFD layouts, unit and
> detection tests
> Evaluated and excluded: Epson ERF (preview lives in the MakerNote), Olympus
> ORF and Panasonic RW2 (non-standard TIFF magic), Fuji RAF (not TIFF), Canon
> CR3 (ISO-BMFF). Verified against CC0 samples from raw.pixls.us (NEX-6,
> DSC-R1, K-7, EOS 7D, K-x and GR DNGs) plus real Nikon D80/D3000 files.
> PR to follow.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)