Created attachment 84189 [details] refactor ImageOutputDev These patches extend pdfimages to support additional output formats such as png, tiff, jpeg2000 etc. The first patch refactors ImageOutputDev to make it easier to add new formats.
Created attachment 84190 [details] [review] Change PNGWriter monochrome format to 8 pixels/byte Currently PNGWriter monochrome format is 1 pixel per byte. This patch changes it to be 8 pixels per byte to be consistent with TiffWriter and NetPBMWriter to they can all be used the same way without special handling.
Created attachment 84191 [details] [review] Add PNG and Tiff support This adds PNG and Tiff file output support to pdfimages.
Created attachment 84192 [details] [review] Add JPEG2000 support This adds a -jp2 option to write out JPEG2000 as JP2 files.
Created attachment 84193 [details] [review] JBIG2 This adds JBIG2 output support. I used the jbig2dec program to test. eg jbig2dec out-003.jb2g out-003.jb2e -o out.png
Created attachment 84337 [details] [review] Change PNGWriter monochrome format to 8 pixels/byte Fix bug.
Created attachment 84339 [details] [review] Add PNG and Tiff support Only support PNG and TIFF if these libraries are enabled.
Created attachment 84558 [details] [review] Add CCITT output Adds -ccitt option to output ccitt images in native format.
Created attachment 84559 [details] [review] Add -all option to enable all formats Add -all option to write out jpeg, jpeg2000, jbig2, and ccitt in native format. Use PNG for other images.
A few things: * I'm not sure i understand "Change PNGWriter monochrome format to be 8 pixels/byte", why we need it? Also is the change in pdftocairo there related? * In "pdfimages: add support for png and tiff output" I'd say "write image in TIFF format" should be "write images in TIFF format", but I actually like the description you put in the man page better, why didn't you use that? Besides that i think they are pretty straighforward. Good work :)
Created attachment 84620 [details] [review] Add PNG and Tiff support Change description of -png and -tiff options to be the same as the man page.
(In reply to comment #9) > A few things: > * I'm not sure i understand "Change PNGWriter monochrome format to be 8 > pixels/byte", why we need it? Also is the change in pdftocairo there related? Currently with TIFFWriter and PNGWriter using different formats for monochrome, pdftocairo needs to check whether tiff or png is being used and adjust the format of the data. By making them use the same format then after creating the ImageWriter object they can both be used the same way without any special case handling of the data. In addition, PDF uses the packed format for monochrome images so by using this format the data can be copied from the stream to the writer without needing to change the data format.
Ok, so i guess you can commit then :-) Cheers!
Pushed
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.