Erik
Erik

Reputation: 14798

ImageMagick:convert unable to crop image

I use the following command to crop big image:

convert hq.jpg -crop 512x512 -set filename:tile "%[fx:page.x/512]-%[fx:page.y/512]" "hq/%[filename:tile].jpg"

But get the following error:

convert: unable to open image `hq/0-0.jpg': No such file or directory @ error/blob.c/OpenBlob/2705.

my version on MacOS is:

Version: ImageMagick 6.9.5-0 Q16 x86_64 2016-07-19 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules 
Delegates (built-in): bzlib djvu fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms ltdl lzma openexr png ps tiff webp x xml zlib

What I'm doing wrong?

Upvotes: 0

Views: 206

Answers (1)

Bonzo
Bonzo

Reputation: 5299

-crop needs an offset which could be your problem e.g. -crop 512x512+0+0

If that does not work I would start off simplifying your code with hardcoded paths and when the crop works start adding the other variables.

Upvotes: 1

Related Questions