Page 1 of 1

Image DPI

Posted: 2013-09-02T08:44:32-07:00
by bigster
Hi,

I´m converting an image doing the rotation of it. But when i´ve got an image with (200X252) in 96 DPI when doing the rotation (-rotate 90) the image stay with 252X200 but with 72 DPI. The image is a JPEG.

Any ideas how can i keep the same DPI for the image, but can´t do the set of the DPI directly (-density 76) because there are several images with several dimensions.

For example i´ve got an image with 300 DPI and when i do the rotation the image keep the 300 DPI, and i don´t know why.


Cheers,

Nuno Ferreira

Re: Image DPI

Posted: 2013-09-02T10:16:36-07:00
by fmw42
Post a link to the image that does not maintain the density? What is your IM version and platform? What version of libjpeg are you using?

Re: Image DPI

Posted: 2013-09-02T10:54:09-07:00
by bigster
Hi,

Here is the image :
Image

The version of the IM is : ImageMagick-6.8.6-Q16 (windows)

Cheers,

Re: Image DPI

Posted: 2013-09-02T11:45:45-07:00
by fmw42
According to IM verbose information, the image has no units defined and no specified density (resolution). EXIFtool says the resolution is 1.

So your input image in this case is not seen to have any proper density defined and thus the output after rotation will be the same.

Whatever tool you are using to look at the density is interpreting it as a default of 72 dpi when actually there is no dpi defined.

If you want the output to have some density, then you can add -units and -density before the output to make it conform.

Alternately, you can check the density (resolution) before processing each image and if there is none, then add the density (and units) you want.

see %x and %y string formats at http://www.imagemagick.org/script/escape.php

Re: Image DPI

Posted: 2013-09-04T11:44:13-07:00
by bigster
Hi,

I will try to look at the info of the original image and put the information to the new image.


Cheers,

Nuno Ferreira