Resolution set to 170 dpi, but Windows Explorer insits on 72 dpi

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
User avatar
whugemann
Posts: 289
Joined: 2011-03-28T07:11:31-07:00
Authentication code: 8675308
Location: Münster, Germany 52°N,7.6°E

Resolution set to 170 dpi, but Windows Explorer insits on 72 dpi

Post by whugemann »

I often rescale photos in order to embed them in a Microsoft Word document and print them. My batch code is basically

Code: Select all

convert %1 -resize 1024x1024">" -quality 80%% -units PixelsPerInch -density 170 "%~dpn1_small.jpg"
This works fine with most JPEGs, i.e. photos and JPEGs exported by Gimp, but fails on JPEGs written with Photoshop, see
http://www.unfallrekonstruktion.de/dacngised/test.jpg.

IM's Identify responds

Code: Select all

Resolution: 170x170
Print size: 6.02353x4.51765
Units: PixelsPerInch
but the Windows Explorer still insists on a horizontal and vertical resolution of 72 dpi, and Word seems to do the same, as the photo will be much too large when inserted into a documented via Drag 'n Drop.

What exactly is the problem?
Wolfgang Hugemann
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Resolution set to 170 dpi, but Windows Explorer insits on 72 dpi

Post by snibgo »

The problem may be Photoshop metadata. Try "-strip" before the output filename.
snibgo's IM pages: im.snibgo.com
User avatar
whugemann
Posts: 289
Joined: 2011-03-28T07:11:31-07:00
Authentication code: 8675308
Location: Münster, Germany 52°N,7.6°E

Re: Resolution set to 170 dpi, but Windows Explorer insits on 72 dpi

Post by whugemann »

The problem seems to be solved in current versions of IM. I have just installed the current version, and now even the JPEGs exported by Photoshop are recognised with the correct resolution -- both by the Windows Explorer and Microsoft Word.

Up to now I still ran IM 6.8.0-1, dating from 2012: This was the version all of my scripts where tested with, and new versions can also mean new bugs. And yes, one should update from time to time, even at the risk of new bugs. But up to now I thought that there was something missing in my command line ...
Wolfgang Hugemann
Post Reply