Identify -verbose: print size and resolution differ from original

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
maen
Posts: 2
Joined: 2017-04-10T10:36:57-07:00
Authentication code: 1151

Identify -verbose: print size and resolution differ from original

Post by maen »

Hello @all,
I want to test size & resolution of pdfs with pdfimages and identify -verbose all.
OS: ubuntu 16.04
Imagemagick: 6.8.9.9-7
Poppler: 0.41

The problem is that although the size of the image is always correct, the print size and the resolution are not correct calculated.

For testing purposes, I took:
Image

Original data:
Image: Mono_Lake_Tufa_300DPI.JPG
Format: JPEG (Joint Photographic Experts Group JFIF format)
Mime type: image/jpeg
Class: DirectClass
Geometry: 5184x3456+0+0
Resolution: 300x300
Print size: 17.28x11.52

Units: PixelsPerInch [...]

Now the tricky part: Creating pdfs, extract images, identify images.

Extracting the data with pdfimages -all ...

1. Creating pdf with Gimp. Gimp seems to convert the JPG into png.
identify -verbose -units PixelsPerInch images-000.png |more

images-000.png
Format: PNG (Portable Network Graphics)
Mime type: image/png
Class: DirectClass
Geometry: 5184x3456+0+0
Resolution: 71.98x71.98 -> Factor 0.24 from Original
Print size: 72.02x48.0133 -> Factor 4.166 from Original
Units: PixelsPerInch

2. Creating pdf with Photoshop. Also converting the JPG into png without asking!
identify -verbose -units PixelsPerInch images-000.png |more
images-000.png
Format: PNG (Portable Network Graphics)
Mime type: image/png
Class: DirectClass
Geometry: 5184x3456+0+0
Resolution: 71.98x71.98 -> Factor 0.24 from Original
Print size: 72.02x48.0133 -> Factor 4.166 from Original
Units: PixelsPerInch

3. Creating pdf with Adobe Indesign. Does not convert into PNG.
identify -verbose -units PixelsPerInch images-000.jpg |more
Image: images-000.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Mime type: image/jpeg
Class: DirectClass
Geometry: 5184x3456+0+0
Units: PixelsPerInch
No Resolution, no Print Size set!

Question:
Could this be a problem of ImageMagick or a poppler Problem?

THX in advance,

Marc
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Identify -verbose: print size and resolution differ from original

Post by snibgo »

maen wrote:Could this be a problem of ImageMagick or a poppler Problem?
What problem?

You have a JPG. You use Gimp, PS and Indesign to make PDFs, then use pdfimages to extract images, which you examine with identify. None of the results have the resolution of the input.

You can confirm the identify result with exiftool. I expect you will find it gives the same results.

The obvious conclusion is that Gimp, PS and Indesign do different things to the metadata of the image, when making the PDF.
snibgo's IM pages: im.snibgo.com
maen
Posts: 2
Joined: 2017-04-10T10:36:57-07:00
Authentication code: 1151

Re: Identify -verbose: print size and resolution differ from original

Post by maen »

ok, thank you.
Post Reply