Bug #67447 [Com]: imagecrop() add a black line when cropping
| From: | arsene dot bruno at gmail dot com | Date: | Tue, 24 Jun 2014 19:24:16 +0000 |
| Subject: | Bug #67447 [Com]: imagecrop() add a black line when cropping | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-186327@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67447&edit=1
ID: 67447
Comment by: arsene dot bruno at gmail dot com
Reported by: tonneaujeremy at gmail dot com
Summary: imagecrop() add a black line when cropping
Status: Open
Type: Bug
Package: GD related
Operating System: Windows and Debian 7
PHP Version: 5.5.13
Block user comment: N
Private report: N
New Comment:
Hi Jeremy,
there is a little typo in your code (it should be $image instead of $images), but after correcting
it I confirm that I experience the same problem. Here is the correct code to test:
$image = imagecreatetruecolor(500, 500);
imagefill($image, 0, 0, imagecolorallocate($image, 255, 255, 255));
$ressource = imagecrop($image, ['x' => 0, 'y' => 0, 'width'
=> 250, 'height' => 250]);
imagejpeg($ressource, 'test.jpg');
Previous Comments:
------------------------------------------------------------------------
[2014-06-15 06:53:45] tonneaujeremy at gmail dot com
Description:
------------
I've create a script based on imagecrop() function to crop an image.
After testing I saw that a black line were added on the bottom of the cropped image.
The expected result sould be a white image (based on the example below) with 250px width and height.
Test script:
---------------
$image = imagecreatetruecolor(500, 500);
imagefill($image, 0, 0, imagecolorallocate($images, 255, 255, 255));
$ressource = imagecrop($image, ['x' => 0, 'y' => 0, 'width'
=> 250, 'height' => 250]);
imagejpeg($ressource, 'test.jpg');
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67447&edit=1