[ 
https://issues.apache.org/jira/browse/TIKA-4824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18105553#comment-18105553
 ] 

ASF GitHub Bot commented on TIKA-4824:
--------------------------------------

dschmidt opened a new pull request, #3037:
URL: https://github.com/apache/tika/pull/3037

   NEF/NRW raw files embed a camera-generated full-resolution JPEG preview 
(SubIFD0, JPEGInterchangeFormat/-Length), but Tika parses NEF as plain TIFF and 
gives no access to it.
   
   * New `NEFParser` (image module): claims `image/x-raw-nikon`, inherits 
TIFF/EXIF/XMP metadata extraction from `TiffParser`, walks IFD0 plus SubIFDs 
and emits each embedded JPEG preview through the `EmbeddedDocumentExtractor` 
(`image/jpeg`, `THUMBNAIL`, `thumbnail-N.jpg`). Offsets/lengths are 
bounds-checked, the JPEG SOI marker is required, IFD counts are capped. 
Configurable via `"nef-parser": {"extractPreviews": false}`.
   * `image/x-raw-nikon` is now a `sub-class-of image/tiff`, so name+data 
detection resolves NEF to the specific type (data-only detection stays 
`image/tiff`, NEF has no reliable magic).
   * Test file `testNEF.nef` (~2KB) is fully synthetic, generated to mirror the 
IFD layout of real D3000/D80 files (no camera data).
   
   Tested: unit tests, detection tests, full image-module suite, plus 
end-to-end against real D80/D3000 NEFs (preview 3872x2592 extracted, /rmeta and 
/unpack deliver it).




> Extract embedded JPEG previews from Nikon NEF raw images
> --------------------------------------------------------
>
>                 Key: TIKA-4824
>                 URL: https://issues.apache.org/jira/browse/TIKA-4824
>             Project: Tika
>          Issue Type: New Feature
>            Reporter: Dominik Schmidt
>            Priority: Major
>
> NEF/NRW files are TIFF-based and embed a camera-generated full-resolution 
> JPEG preview (SubIFD0, JPEGInterchangeFormat/-Length). Tika currently has no 
> access to it: image/x-raw-nikon is glob-only and not a sub-class of 
> image/tiff, no parser claims the type, 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 NEF (analogous to TIKA-4801 for audio 
> cover art).
> Proposal:
> - New NEFParser in tika-parser-image-module: TIFF metadata via TiffParser, 
> walks IFD0 + SubIFDs and emits each JPEG preview through the 
> EmbeddedDocumentExtractor (image/jpeg, THUMBNAIL); configurable via 
> "nef-parser": {"extractPreviews": false}
> - Add sub-class-of image/tiff to image/x-raw-nikon so name+data detection 
> resolves NEF
> - Synthetic ~2KB test NEF mirroring the real IFD layout, unit and detection 
> tests
> PR to follow.



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

Reply via email to