Dominik Schmidt created TIKA-4851:
-------------------------------------

             Summary: RawTiffParser: mark only the largest JPEG preview as 
THUMBNAIL
                 Key: TIKA-4851
                 URL: https://issues.apache.org/jira/browse/TIKA-4851
             Project: Tika
          Issue Type: New Feature
            Reporter: Dominik Schmidt


RawTiffParser (TIKA-4824) emits every JPEG preview found in the IFD chain and 
SubIFDs as an embedded document with tk:embedded-resource-type=THUMBNAIL, in 
IFD walk order. A NEF typically carries a 160x120 thumbnail in IFD0 and a 
full-size preview in a SubIFD, DNG and CR2 similar, so the first THUMBNAIL is 
usually the smallest one. A client that wants the representative image has to 
parse the dimensions of every preview and pick the largest, which is a 
format-specific special case again; every other parser that emits THUMBNAIL 
emits exactly one.

Proposal:
- Only the largest preview (by JPEG byte length, or by the IFD's 
ImageWidth/ImageLength when present) is marked THUMBNAIL and emitted first.
- The remaining previews are still extracted, marked INLINE (they are 
renderings of the same image, not attachments), keeping the current thumbnail_N 
generated names or switching the smaller ones to an image_N prefix.

Motivation for both tickets: a generic "first THUMBNAIL is the preview" rule 
across all formats in a downstream consumer (OpenCloud's Tika extractor).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to