|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-04-15 19:07 UTC] xing at mac dot com
[2009-04-16 01:18 UTC] xing at mac dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 11:00:01 2025 UTC |
Description: ------------ Tested this with latest ImageMagick install and both 2.2.2 and 2.3.0beta with same result. When paired with 5.3DEV04-15-2009 snapshot, the following very simple image resizing script would require an usually high amount of CPU processing time. On a quad core xeon system, the script wold cause 300% cpu usage. This is not the case with 5.2.X where cpu usage is normal, in the single digitis, and the script runs very fast, as expected. I ran this no other extension active except for imagick to finally isolate the problem to this. Reproduce code: --------------- size = 25; $pic_data = file_get_contents("../static/images/default.png"); or $pic_data = blob from db; $im = thumbnail::resize_blob($pic_data, $size, $size); $output = $im->getimageblob(); $outputtype = $im->getFormat(); -------------------------------- thumbnail class ---------------- <? class thumbnail { static public function resize_blob($blob, $i_width, $i_height) { $image = new Imagick(); $image->readimageblob($blob); $image->cropThumbnailImage($i_width, $i_height); return $image; } } ?> Expected result: ---------------- Very fast scaling of a 150x150png image/blob to 25x25png. Actual result: -------------- Extremely slow result with extremely high CPU spike.