com php-src: Merge branch 'PHP-5.6': ext/gd/gd.c

From: Date: Wed, 15 Oct 2014 17:43:30 +0000
Subject: com php-src: Merge branch 'PHP-5.6': ext/gd/gd.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-82360@lists.php.net to get a copy of this message
Commit: c03b6e1701caf5c0c7df9dbdd50f6fcc7db15e80 Author: Ferenc Kovacs <tyrael@php.net> Wed, 15 Oct 2014 19:43:30 +0200 Parents: d2ab6e1d15f58cb4f53c0a69c438c0721264455a cfa1028d7e3942d6921d2c3ba5fba1be3ea78400 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c03b6e1701caf5c0c7df9dbdd50f6fcc7db15e80 Log: Merge branch 'PHP-5.6' * PHP-5.6: NEWS Fixed Bug #65171 imagescale() fails Revert "Bug #41631: Observe socket read timeouts in SSL streams" Bugs: https://bugs.php.net/65171 https://bugs.php.net/41631 Changed paths: MM ext/gd/gd.c Diff: diff --cc ext/gd/gd.c index 54d0254,7bf0b75..5a82086 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@@ -5046,11 -5118,23 +5046,23 @@@ PHP_FUNCTION(imagescale return; } method = tmp_m; - new_width = tmp_w; - new_height = tmp_h; - ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd); + ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); + if (tmp_h < 0) { + /* preserve ratio */ + long src_x, src_y; + + src_x = gdImageSX(im); + src_y = gdImageSY(im); + if (src_x) { + tmp_h = tmp_w * src_y / src_x; + } + } + + new_width = tmp_w; + new_height = tmp_h; + if (gdImageSetInterpolationMethod(im, method)) { im_scaled = gdImageScale(im, new_width, new_height); }

« previous php.cvs (#82360) next »