Why can't I change dpi on my jpg picture?

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
benny

Why can't I change dpi on my jpg picture?

Post by benny »

This is my code:

Code: Select all

$exec = "convert '$input' -resize 535x535 -units PixelsPerInch -density 72 -quality 60 '$output'";
The source file is a 10 mb tif file that I'm converting to a jpg. The dpi on the tif file is 900, the dpi on the jpg is still 900. Why does my code not change the dpi on my jpg to 72?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Why can't I change dpi on my jpg picture?

Post by anthony »

If you read the TIF and JPG files in photoshop, that it is not using the normal DPI setting, but the one in the PHotoshop specific meta-data profile. You could -strip all those profiles to remove it.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
fluidmindorg

Re: Why can't I change dpi on my jpg picture?

Post by fluidmindorg »

Awesome! Just adding -strip fixed it for me.

Thanks a lot, man!

--Dan
Post Reply