Bug 99988

Summary: pdfimages does not save 16bpc bitmaps
Product: poppler Reporter: Brecht Machiels <brecht>
Component: utilsAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: PDF with 16 bpc bitmap
16 bpc tiff image support
16 bpc png and tiff image support

Description Brecht Machiels 2017-02-27 17:55:20 UTC
If a PDF contains a bitmap with 16 bits per channel, pdfimages will save it as a 8 bpc bitmap.
Comment 1 Adrian Johnson 2017-02-27 21:15:37 UTC
We need a sample PDF with a 16 bpc image.
Comment 2 Brecht Machiels 2017-02-28 09:09:24 UTC
Created attachment 129977 [details]
PDF with 16 bpc bitmap
Comment 3 Brecht Machiels 2017-02-28 09:32:50 UTC
$ pdfimages -list basn2c16_device.pdf
page   num  type   width height color comp bpc  enc interp  object ID x-ppi y-ppi size ratio
--------------------------------------------------------------------------------------------
   1     0 image      32    32  rgb     3  16  image  no         4  0    72    72  229B 3.7%

$ pdfimages basn2c16_device.pdf basn2c16_device
$ identify basn2c16_device-000.ppm
basn2c16_device-000.ppm PPM 32x32 32x32+0+0 8-bit sRGB 3.08KB 0.000u 0:00.000

$ pdfimages -all basn2c16_device.pdf basn2c16_device
$ identify basn2c16_device-000.png
basn2c16_device-000.png PNG 32x32 32x32+0+0 8-bit sRGB 237B 0.000u 0:00.000
Comment 4 Adrian Johnson 2017-03-01 11:20:14 UTC
Created attachment 129996 [details] [review]
16 bpc tiff image support
Comment 5 Adrian Johnson 2017-03-01 11:41:20 UTC
Created attachment 129997 [details] [review]
16 bpc png and tiff image support
Comment 6 Albert Astals Cid 2017-03-03 21:44:30 UTC
Adrian, looks good to me, please commit.

I'd personally prefer if you moved the Gushort *rowp16; declaration inside the case, I know poppler mostly doesn't use that style but i appreciate vars being declarated in the smalled scope possible (you may actually need to add some {})
Comment 7 Adrian Johnson 2017-03-04 00:26:01 UTC
I've moved the declaration to to case statement. Pushed.
Comment 8 Brecht Machiels 2017-03-13 10:22:06 UTC
Thanks Adrian!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.