com php-src: fix #64898imagerotate is broken with bilinear interpolation: ext/gd/libgd/gd_interpolation.c
| From: | Pierre Joye | Date: | Mon, 27 May 2013 07:21:41 +0000 |
| Subject: | com php-src: fix #64898imagerotate is broken with bilinear interpolation: ext/gd/libgd/gd_interpolation.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-72244@lists.php.net to get a copy of this message | ||
Commit: 2f01e06786c6f4b2479fdb728bd26062d07208e0
Author: Pierre Joye <pierre.php@gmail.com> Mon, 27 May 2013 09:21:41 +0200
Parents: b262787ef9861a3a61f46ba4031f5aa6659eb7fb
Branches: PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2f01e06786c6f4b2479fdb728bd26062d07208e0
Log:
fix #64898imagerotate is broken with bilinear interpolation
Bugs:
https://bugs.php.net/64898
Changed paths:
M ext/gd/libgd/gd_interpolation.c
Diff:
diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c
index 6c5549e..bcd76e9 100644
--- a/ext/gd/libgd/gd_interpolation.c
+++ b/ext/gd/libgd/gd_interpolation.c
@@ -1830,18 +1830,18 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const
int
const gdFixed f_w4 = gd_mulfx(f_f, f_g);
if (n < src_w - 1) {
- src_offset_x = m + 1;
- src_offset_y = n;
+ src_offset_x = n + 1;
+ src_offset_y = m;
}
if (m < src_h-1) {
- src_offset_x = m;
- src_offset_y = n + 1;
+ src_offset_x = n;
+ src_offset_y = m + 1;
}
if (!((n >= src_w-1) || (m >= src_h-1))) {
- src_offset_x = m + 1;
- src_offset_y = n + 1;
+ src_offset_x = n + 1;
+ src_offset_y = m + 1;
}
{
const int pixel1 = src->tpixels[src_offset_y][src_offset_x];