Page 1 of 1

Is it bug in MagickRotateImage?

Posted: 2007-02-14T12:00:57-07:00
by Jacob

Code: Select all

$rot_color = "#FFFFFF";
$degrees = 45;
MagickRotateImage($mw, NewPixelWand($rot_color), $degrees);
picture is 2.8MB 2304 x 3456 (8.0 MP) 24-bit color jpg not small but not super big.
procedure use 1GB in disc, 450MB in memory and after 15min it not finish.
Processor used 2-4%.
Is it bug or this picture over limits?

Re: Is it bug in MagickRotateImage?

Posted: 2007-02-14T15:22:14-07:00
by magick
Not a bug. ImageMagick is caching your image to disk which is 1000 times slower than in-memory image rotation. See http://magick.imagemagick.org/script/architecture.php for a discussion of the pixel cache.

Re: Is it bug in MagickRotateImage?

Posted: 2007-02-15T13:44:40-07:00
by Jacob
Thank you for this info, i miss it when try looking help.
I set MAGICK_DISK_LIMIT = 2GB MAGICK_MAP_LIMIT = 1500MB MAGICK_MEMORY_LIMIT = 800MB

Code: Select all

montage.exe -rotate "45" 2.jpg 3.jpg
work fine

Re: Is it bug in MagickRotateImage?

Posted: 2007-02-17T11:33:24-07:00
by Jacob
php script work too if set MagickSetResourceLimit (can't set it in php.ini? )
but small strange in architecture.php i see
if we have a 640 by 480 image and we're using the Q16 version of ImageMagick, the pixel cache consumes image width * height * bit-depth / 8 * channels bytes or approximately 2.3 megabytes (i.e. 640 * 480 * 2 * 4).
ok my picture is 2304 x 3456 (8.0 MP) 24-bit Q16 = 2304*3456*24/8*4=95.5MB
why it need 730MB memory to finish work?

Re: Is it bug in MagickRotateImage?

Posted: 2007-02-17T12:36:09-07:00
by magick
You have two images in memory, the original and the rotated. The rotated image is oversized until it is cropped.