Bug 68239 - Add support for more image format to pdfimages
Summary: Add support for more image format to pdfimages
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: utils (show other bugs)
Version: unspecified
Hardware: Other All
: medium enhancement
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-18 11:38 UTC by Adrian Johnson
Modified: 2013-08-25 22:14 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
refactor ImageOutputDev (16.64 KB, text/plain)
2013-08-18 11:38 UTC, Adrian Johnson
Details
Change PNGWriter monochrome format to 8 pixels/byte (2.90 KB, patch)
2013-08-18 11:40 UTC, Adrian Johnson
Details | Splinter Review
Add PNG and Tiff support (8.97 KB, patch)
2013-08-18 11:41 UTC, Adrian Johnson
Details | Splinter Review
Add JPEG2000 support (4.63 KB, patch)
2013-08-18 11:42 UTC, Adrian Johnson
Details | Splinter Review
JBIG2 (6.35 KB, patch)
2013-08-18 11:44 UTC, Adrian Johnson
Details | Splinter Review
Change PNGWriter monochrome format to 8 pixels/byte (4.44 KB, patch)
2013-08-20 13:59 UTC, Adrian Johnson
Details | Splinter Review
Add PNG and Tiff support (9.08 KB, patch)
2013-08-20 14:00 UTC, Adrian Johnson
Details | Splinter Review
Add CCITT output (5.96 KB, patch)
2013-08-24 12:08 UTC, Adrian Johnson
Details | Splinter Review
Add -all option to enable all formats (2.78 KB, patch)
2013-08-24 12:09 UTC, Adrian Johnson
Details | Splinter Review
Add PNG and Tiff support (8.78 KB, patch)
2013-08-25 20:50 UTC, Adrian Johnson
Details | Splinter Review

Description Adrian Johnson 2013-08-18 11:38:32 UTC
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.
Comment 1 Adrian Johnson 2013-08-18 11:40:40 UTC
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.
Comment 2 Adrian Johnson 2013-08-18 11:41:28 UTC
Created attachment 84191 [details] [review]
Add PNG and Tiff support

This adds PNG and Tiff file output support to pdfimages.
Comment 3 Adrian Johnson 2013-08-18 11:42:31 UTC
Created attachment 84192 [details] [review]
Add JPEG2000 support

This adds a -jp2 option to write out JPEG2000 as JP2 files.
Comment 4 Adrian Johnson 2013-08-18 11:44:29 UTC
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
Comment 5 Adrian Johnson 2013-08-20 13:59:38 UTC
Created attachment 84337 [details] [review]
Change PNGWriter monochrome format to 8 pixels/byte

Fix bug.
Comment 6 Adrian Johnson 2013-08-20 14:00:45 UTC
Created attachment 84339 [details] [review]
Add PNG and Tiff support

Only support PNG and TIFF if these libraries are enabled.
Comment 7 Adrian Johnson 2013-08-24 12:08:20 UTC
Created attachment 84558 [details] [review]
Add CCITT output

Adds -ccitt option to output ccitt images in native format.
Comment 8 Adrian Johnson 2013-08-24 12:09:34 UTC
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.
Comment 9 Albert Astals Cid 2013-08-25 18:33:53 UTC
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 :)
Comment 10 Adrian Johnson 2013-08-25 20:50:05 UTC
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.
Comment 11 Adrian Johnson 2013-08-25 20:56:39 UTC
(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.
Comment 12 Albert Astals Cid 2013-08-25 21:08:05 UTC
Ok, so i guess you can commit then :-)

Cheers!
Comment 13 Adrian Johnson 2013-08-25 22:14:10 UTC
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.