Re: graphicsmagick won't "gm identify" resolution correctly
Bob Friesenhahn <[email protected]> Thu, 5 Aug 2004 09:59:06 -0500 (CDT)
| Newsgroups | gmane.comp.video.graphicsmagick.bugs |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 5 Aug 2004, Benjamin Adler wrote: > I have some tif-files on which "gm identify [-verbose]" shows a resolution of > 0, 0 pixels/inch. Quite possibly that is only with files that have been > created with a certain version of Kodak's DCS PhotoDesk. Photoshop shows a > resolution of 72dpi on those images. > > The example.tif can be downloaded at > http://politbuero.dyndns.org/example.tif.bz2. Sorry, the file is 11mb in > size, I had no smaller file showing this problem, and when I open and save it > it photoshop, the problem is gone. Can an image have a resolution of 0 dpi? > Is there any way to fix this, other than opening and saving all those files > in photoshop? A returned resolution of 0 dpi indicates that the image file does not contain a resolution setting. Many/most image file formats do not support a resolution setting. For others, it is optional. Photoshop is likely "fixing" the resolution by updating the image with a default resolution value. You can fix the resolution setting for images that lack an existing setting by executing gm mogrify -density 150x150 example.tif Unfortunately, in order to not overwrite an existing resolution, you would need to use something like gm identify -format "%xx%y" example.tif to query the existing resolution and only update it if the result is "0x0" (or some other value which is unacceptable to you). Bob ====================================== Bob Friesenhahn [email protected] http://www.simplesystems.org/users/bfriesen ------------------------------------------------------- This SF.Net email is sponsored by OSTG. Have you noticed the changes on Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, one more big change to announce. We are now OSTG- Open Source Technology Group. Come see the changes on the new OSTG site. www.ostg.com