Page 1 of 1

rotation of large image file

Posted: 2008-08-15T15:12:04-07:00
by robgfx
Hi folks

So I've been trying to batch process a number of geographic image files. They need to be rotated at unique angles. Since they are map files, they are very high res. I'm getting an error where if I do:

convert ./myImage.png +distort SRT -40 +repage ./myImage-rotated.png

My final image does not actually rotate, instead it comes back with the canvas resized (to the correct size if it were rotated) with the original image at the top and a lot of black in the bottom half. The image is 14997x5592 pixels, and this command works for all other images, so I suspect it's a memory issue and IM is just crashing without a message.

Note, if I do:
convert ./myImage.png -rotate '-40>' ./myImage-rotated.png
It runs for about 3 min. then I get this error:
convert: Memory allocation failed 'Cannot allocate memory'.

I am using ImageMagick 6.4.0 04/17/08 Q16 (32-bit, although I am running XP x64)

So it seems like a memory allocation constraint. I have 4G on my machine and the convert process is using 664,000KB which I assume is the limit?

Any advice?

Re: rotation of large image file

Posted: 2008-08-15T16:21:15-07:00
by magick
> convert ./myImage.png +distort SRT -40 +repage ./myImage-rotated.png

Its always a good idea to upgrade but this may work as well:
  • convert -limit memory 1mb ./myImage.png +distort SRT -40 +repage ./myImage-rotated.png
If that fails, add -limit map 1mb to your command line. If that fails you may not have enough temporary disk space. If you have a non-standard disk partition you can use it for the ImageMagick pixel cache with this option:
  • -define registry:temporary-path=f:\tmp

Re: rotation of large image file

Posted: 2008-08-18T07:27:56-07:00
by robgfx
I upgraded to 6.4.2 (last week's release) and downloaded the windows 64-bit binaries, went into /cygwin/usr/bin and moved that old convert.exe and replaced it with a symbolic link to the new imagemagick, and this rotation now works!

So I don't know if it was the 64-bit build or simply the updated version that fixed this for me, but I got it working.

Thanks magick.