Summary: | [pdfimages] Feature request: additional column for '-list' indicating disk space consumption by embedded image | ||
---|---|---|---|
Product: | poppler | Reporter: | pipitas |
Component: | utils | Assignee: | poppler-bugs <poppler-bugs> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | enhancement | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
print extra image info
fix bug in pdfimages -list output print extra image info print extra image info |
Description
pipitas
2012-07-30 22:03:41 UTC
Created attachment 84170 [details] [review] print extra image info I recently had the need to get additional image info (including the embedded size) from pdfimages. The attached patch adds a '-list-extra' option to pdfimages to list the image info with the following extra columns: - horizontal and vertical image pixels per inch (some pdfs have different values for these) - embedded image size - compression ratio I'm not sure whether it is better to use a separate option for the extra info (as I did with this patch) or just add the columns to the existing -list output. Created attachment 84171 [details] [review] fix bug in pdfimages -list output Fix for a bug I found in the pdfimages -list output while testing the previous patch. Looks ok to me, I haven't checked the code to be totally correct, but if it breaks, it will only break the new feature, and that's reason enough to commit it to master and let it mature in there. So for me you can commit it, maybe wait a few days in case someone else has some comments. Any opinion on whether to use the '-list-extra' option or add the columns to the existing output? I'm not sure what our policy is on changing the output of the utils. i think the policy is "try to break stuff as little as possible" I understand that in your case, logically it makes sense to add stuff before the objectID, but maybe you could add it after? that way it's harder we break stuff that parses the output? otoh if you want the list-extra i'm fine with that too What's your opinion? Created attachment 84386 [details] [review] print extra image info Adding '-list-extra' seems kind of awkward. Adding the columns after the object ID is probably better. It preserves compatibility and allows us to append another column to the end if we find something else is needed. I've changed the patch to implement this as well to fix: - the ppi of rotated images - size of inline images (ie not supported) - print ppi if < 1 (one of the PDFs had a 1x1 image that was stretched out to a much larger size). Created attachment 84388 [details] [review] print extra image info fix bug Looks sane, you probably want to remove the change in pdfimages.cc though ;-) If you've run this all over the reg test files, feel free to commit. If not tell me and i'll do. I ran pdfimages -list over the reg test files to see if there any any crashes. Go for it then :-) Pushed Thank you very much for this new feature in pdfimages! I use it a *lot*, it's very useful to me. |
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.