Problems with -density if -unit PixelsPerInch not specificied before input image

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problems with -density if -unit PixelsPerInch not specificied before input image

Post by fmw42 »

I will just add a note.

Imagemagick processing is not done in the same order as typical Unix commands. Although IM 6 is forgiving in many ways, IM 7 is very strict in the order of things in the command line.

See

https://www.imagemagick.org/Usage/basics/#cmdline

and the following sections about order of the command line.
vartlok
Posts: 5
Joined: 2018-08-14T03:57:55-07:00
Authentication code: 1152

Re: Problems with -density if -unit PixelsPerInch not specificied before input image

Post by vartlok »

I want to convert image to new image with resolution 350 and unit PixelsPerInch, but IM's converting resolution 350 -> 889 and update unit.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Problems with -density if -unit PixelsPerInch not specificied before input image

Post by snibgo »

Your correct command does exactly that, for me using IM v7.0.8-10:

Code: Select all

C:\www\im>%IM%magick source.jpg -units PixelsPerInch -density 350 out.jpg

C:\www\im>%IM%magick identify -verbose out.jpg
Image: out.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Mime type: image/jpeg
  Class: DirectClass
  Geometry: 562x360+0+0
  Resolution: 350x350
  Print size: 1.60571x1.02857
  Units: PixelsPerInch
snibgo's IM pages: im.snibgo.com
vartlok
Posts: 5
Joined: 2018-08-14T03:57:55-07:00
Authentication code: 1152

Re: Problems with -density if -unit PixelsPerInch not specificied before input image

Post by vartlok »

Ah, my bad. I'm using imagemagick/7.0.8-10/bin/convert instead of imagemagick/7.0.8-10/bin/magic
Post Reply