Page 1 of 1

Convert function does not resize image

Posted: 2009-09-13T02:51:41-07:00
by djest
When I try to resize image
# convert ./files/property/source/191.jpg -resize 140x105> -quality 95 -antialias ./files/property/image/0/191.jpg

It shows me an error:
convert: unable to open image `95': No such file or directory @ magick/blob.c/OpenBlob/2418.

But the same function works with other images, so it does not work for some images but they are normal in browser, image viewers, photoshop, etc.

# identify ./files/property/source/191.jpg
./files/property/source/191.jpg JPEG 3264x2448 3264x2448+0+0 8-bit DirectClass 2.5mb 0.610u 0:02

# convert -version
Version: ImageMagick 6.4.5 2008-11-13 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC

and the same problem with the Windows imagemagick

Version: ImageMagick 6.5.4-10 2009-08-08 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

Re: Convert function does not resize image

Posted: 2009-09-13T07:48:03-07:00
by magick
Try this
  • convert ./files/property/source/191.jpg -resize 140x105\> -quality 95 -antialias ./files/property/image/0/191.jpg

Re: Convert function does not resize image

Posted: 2009-09-13T07:58:17-07:00
by djest
Thanks!
It works fine.

Also I found solution it can be quoted:

convert "./files/property/source/191.jpg" -resize "140x105>" -quality 95 -antialias "./files/property/image/0/191.jpg"

Re: Convert function does not resize image

Posted: 2009-09-13T18:32:18-07:00
by anthony
As a FYI what is happening is that the shell sees the pattern....

Code: Select all

   > -quality
It then creates a file called "-quality" (which you may like to delete now), and redirects the normal output of the convet command to it (heir is no output so file remains empty).

the convert command then sees...

Code: Select all

convert "./files/property/source/191.jpg" -resize 140x105  95 -antialias "./files/property/image/0/191.jpg"
So it thinks "95" is an image (as it isn't a known option) and tries to read it as an image. Thus producing the error you see.