Is it bug in MagickRotateImage?

MagickWand for PHP is an object-oriented PHP interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning MagickWand for PHP.
Post Reply
Jacob

Is it bug in MagickRotateImage?

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

Re: Is it bug in MagickRotateImage?

Post 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.
Jacob

Re: Is it bug in MagickRotateImage?

Post 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
Jacob

Re: Is it bug in MagickRotateImage?

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

Re: Is it bug in MagickRotateImage?

Post by magick »

You have two images in memory, the original and the rotated. The rotated image is oversized until it is cropped.
Post Reply