diff options
author | Xinchen Hui <laruence@gmail.com> | 2013-12-15 16:55:29 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2013-12-15 16:55:29 +0800 |
commit | 5eb8d9d70009c0bf9bfbbf511f2713e64dc8ee83 (patch) | |
tree | 2480a26e79d85b4b7f2eacb5a2187eb13f029094 /ext/gd/libgd/gd_interpolation.c | |
parent | 10964b78548a5878254f5aa75f4cfdcedb0543bc (diff) | |
parent | 904721189ff949c67795ec418f04b67951cbd57b (diff) | |
download | php-git-5eb8d9d70009c0bf9bfbbf511f2713e64dc8ee83.tar.gz |
Merge branch 'PHP-5.6' of https://git.php.net/push/php-src into PHP-5.6
Diffstat (limited to 'ext/gd/libgd/gd_interpolation.c')
-rw-r--r-- | ext/gd/libgd/gd_interpolation.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c index 3643535f2e..e34242bb73 100644 --- a/ext/gd/libgd/gd_interpolation.c +++ b/ext/gd/libgd/gd_interpolation.c @@ -1,4 +1,5 @@ /* + * The two pass scaling function is based on: * Filtered Image Rescaling * Based on Gems III * - Schumacher general filtered image rescaling @@ -13,6 +14,7 @@ * * Initial sources code is avaibable in the Gems Source Code Packages: * http://www.acm.org/pubs/tog/GraphicsGems/GGemsIII.tar.gz + * */ /* @@ -816,10 +818,6 @@ int getPixelInterpolated(gdImagePtr im, const double x, const double y, const in return -1; } - /* Default to full alpha */ - if (bgColor == -1) { - } - if (im->interpolation_id == GD_WEIGHTED4) { return getPixelInterpolateWeight(im, x, y, bgColor); } @@ -1711,6 +1709,7 @@ gdImagePtr gdImageRotateNearestNeighbour(gdImagePtr src, const float degrees, co gdImagePtr gdImageRotateGeneric(gdImagePtr src, const float degrees, const int bgColor) { float _angle = ((float) (-degrees / 180.0f) * (float)M_PI); + const int angle_rounded = (int)floor(degrees * 100); const int src_w = gdImageSX(src); const int src_h = gdImageSY(src); const unsigned int new_width = (unsigned int)(abs((int)(src_w * cos(_angle))) + abs((int)(src_h * sin(_angle))) + 0.5f); @@ -1733,6 +1732,10 @@ gdImagePtr gdImageRotateGeneric(gdImagePtr src, const float degrees, const int b : 0; + if (bgColor < 0) { + return NULL; + } + dst = gdImageCreateTrueColor(new_width, new_height); if (!dst) { return NULL; |