|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-01-14 12:49 UTC] mmalone at nutshell dot com
[2010-01-21 08:43 UTC] andy at steamshift dot net
[2010-01-30 23:01 UTC] spinn909 at gmail dot com
[2010-02-10 18:13 UTC] mkoppanen@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 13:00:01 2025 UTC |
Description: ------------ Maybe I'm misunderstanding the purpose of this function, but it's producing strange and counter-intuitive results, and it's definitely inconsistent with the Imagick function of the same name. Here's a version of the reproduce code that uses Imagick::cropThumbnailImage(). It corresponds to what I put in "Actual results", since it behaves as I would expect from the description. <? if (!file_exists('php.gif')) { file_put_contents('php.gif', file_get_contents('http://www.php.net/images/php.gif')); } $image = new Imagick('php.gif'); echo "Width: {$image->getImageWidth()}, height: {$image->getImageHeight()}\n"; $thumb = $image->clone(); $thumb->cropThumbnailImage(50, 50); echo "Thumbnail width: {$thumb->getImageWidth()}, height: {$thumb->getImageHeight()}\n"; $thumb->writeImage('php_thumbi.gif'); Reproduce code: --------------- <? if (!file_exists('php.gif')) { file_put_contents('php.gif', file_get_contents('http://www.php.net/images/php.gif')); } $image = new Gmagick('php.gif'); echo "Width: {$image->getImageWidth()}, height: {$image->getImageHeight()}\n"; $thumb = $image->cropThumbnailImage(50, 50); echo "Thumbnail width: {$thumb->getImageWidth()}, height: {$thumb->getImageHeight()}\n"; $thumb->write('php_thumb.gif'); Expected result: ---------------- EXPECTED OUTPUT: Width: 120, height: 67 Thumbnail width: 50, height: 50 EXPECTED IMAGE: http://img29.imageshack.us/img29/6033/phpthumbi.gif Actual result: -------------- ACTUAL OUTPUT: Width: 120, height: 67 Thumbnail width: 31, height: 50 ACTUAL IMAGE: http://img251.imageshack.us/img251/2497/phpthumb.gif