Bug #66714 [Com]: imageconvolution processing output inconsistent with previous versions
| From: | chris at lodesys dot com | Date: | Tue, 18 Feb 2014 08:16:09 +0000 |
| Subject: | Bug #66714 [Com]: imageconvolution processing output inconsistent with previous versions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-184342@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66714&edit=1
ID: 66714
Comment by: chris at lodesys dot com
Reported by: drew dot mclellan at gmail dot com
Summary: imageconvolution processing output inconsistent with
previous versions
Status: Open
Type: Bug
Package: GD related
Operating System: Linux
PHP Version: 5.5.9
Block user comment: N
Private report: N
New Comment:
Seeing the same problem in Windows.
In testing, it appears that the $sharpenMatrix is being ignored by imageconvolution() and a matrix
of all 1's is being used instead. This results in a blurred image no matter what values are
used for $sharpenMatrix.
I consider this a critical bug as my sites rely on the ability to resize and sharpen images (with
imageconvolution). Have had to revert to 5.9.8.
Previous Comments:
------------------------------------------------------------------------
[2014-02-14 19:22:34] drew dot mclellan at gmail dot com
Description:
------------
The behaviour of imageconvolution() appears to have changed in PHP 5.5.9. The results are visual, so
hard to describe, but the behaviour is significantly different from earlier versions.
The test script is boilerplate code for basic image sharpening, as found all over the web. In PHP
5.5.9 the result is a loss of brightness in the resulting image.
Test script:
---------------
$image = imagecreatefromjpeg('/path/to/picture.jpg');
$matrix = array(array(-1, -1, -1), array(-1, 20, -1), array(-1, -1, -1));
$divisor = array_sum(array_map('array_sum', $matrix));
imageconvolution($image, $matrix, $divisor, 0);
echo imagecolorat($image, 0, 0);
Expected result:
----------------
The echo'd output (colour reference number at 0,0) should be the same in PHP 5.5.8 and 5.5.9
for the same input image.
Actual result:
--------------
The output number is much lower in 5.5.9 than 5.5.8, indicating a darker colour and a loss of
brightness. The issue is that the behaviour has changed.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66714&edit=1