note 56052 deleted from function.imagerotate by danbrown
| From: | danbrown@php.net | Date: | Tue, 02 Dec 2008 15:00:54 +0000 |
| Subject: | note 56052 deleted from function.imagerotate by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-147538@lists.php.net to get a copy of this message | ||
Note Submitter: kumm at webstar dot hu
----
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