Bug #67447 [Opn]: imagecrop() add a black line when cropping

From: Date: Mon, 29 Jun 2015 00:06:40 +0000
Subject: Bug #67447 [Opn]: imagecrop() add a black line when cropping
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193975@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 Updated by: cmb@php.net 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 +PHP Version: 5.6.10 Block user comment: N Private report: N New Comment: PR php-src/1373 is supposed to solve the issue. Previous Comments: ------------------------------------------------------------------------ [2014-06-24 19:24:15] arsene dot bruno at gmail dot com 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'); ------------------------------------------------------------------------ [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

« previous php.bugs (#193975) next »