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

   https://issues.apache.org/jira/browse/TIKA-4937
   
   `ImageParser` claimed `image/x-icon`, but ImageIO has no ICO reader, so a 
`.ico` yielded nothing beyond its content type. This PR adds a small dedicated 
`ICOParser` (no new dependency) for `image/vnd.microsoft.icon` and 
`image/x-win-bitmap`:
   
   - Reads the ICONDIR and the header of every image, PNG IHDR or 
BITMAPINFOHEADER. The directory's own width/height/bpp fields are unreliable 
(256 px is stored as 0) and serve only as fallback.
   - Sets `tiff:ImageWidth`, `tiff:ImageLength`, `tiff:BitsPerSample` of the 
largest image (larger area first, then higher colour depth, as Windows picks), 
`icon:image-count`, one `icon:images` value per image (`WxH@bpp encoding`) and, 
for cursors, `icon:hotspot-x` / `icon:hotspot-y`.
   - Nothing is decoded. Images beyond the end of the file or without a 
readable header are counted in a warning, never an exception.
   - Adds `image/x-win-bitmap` (Windows cursor, `*.cur`, magic `00 00 02 00`) 
to `tika-mimetypes.xml`, registers the `icon:` keys in `tika-metadata-schema` 
(regenerated, four keys added, nothing dropped), removes `image/x-icon` from 
`ImageParser`, and documents the parser.
   
   Fixtures are generated: an icon with 16/32 px BMP and 256 px PNG images, a 
BMP-only icon and a two-image cursor. Tests cover both encodings, cursor 
hotspots, auto-detection, truncation, directory fallback and rejection of 
non-icon input; `TestMimeTypes` covers `.ico`/`.cur` detection.
   
   Follows up on TIKA-4936, whose embedded EXE/DLL icons now get dimensions in 
`/rmeta`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to