Convert function does not resize 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.
Post Reply
djest

Convert function does not resize image

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Convert function does not resize image

Post by magick »

Try this
  • convert ./files/property/source/191.jpg -resize 140x105\> -quality 95 -antialias ./files/property/image/0/191.jpg
djest

Re: Convert function does not resize image

Post 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"
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Convert function does not resize image

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply