note 56052 added to function.imagerotate
| From: | kumm at webstar dot hu | Date: | Mon, 22 Aug 2005 07:59:23 +0000 |
| Subject: | note 56052 added to function.imagerotate | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94015@lists.php.net to get a copy of this message | ||
A better bugfix for jonathan AT sharpmedia DOT net's rotateImage function
you need to replace:
// Now copy tmp2 to $out;
imagecopy($out, $tmp2, 0, 0, ($angle == 270 ? abs($w - $h) : 0), 0, $h, $w);
with:
// Now copy tmp2 to $out;
if ($h>$w) {
imagecopy($out, $tmp2, 0, 0, 0, ($angle == 90 ? abs($w - $h) : 0), $h, $w);
} else {
imagecopy($out, $tmp2, 0, 0, ($angle == 270 ? abs($w - $h) : 0), 0, $h, $w);
}
otherwise the image gets moved when rotating a standing up image
----
Manual Page -- http://www.php.net/manual/en/function.imagerotate.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56052
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56052&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56052&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56052&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56052&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56052&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56052&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56052&report=yes
Search -- http://master.php.net/manage/user-notes.php