|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71218 imagecropauto introduces black line
Submitted: 2015-12-25 17:19 UTC Modified: 2016-07-23 17:58 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: flip101 at gmail dot com Assigned: cmb (profile)
Status: Duplicate Package: GD related
PHP Version: 5.6.16 OS: Windows 7 64bits
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: flip101 at gmail dot com
New email:
PHP Version: OS:


 [2015-12-25 17:19 UTC] flip101 at gmail dot com
When cropping an image suddenly a black line appears at the bottom of the image. To demonstrate this you can have a look at where i combined the cropped and non-cropped in the same image. Of course you can not see the original image borders in this representation. So if it's not clear to you, just run the test script, twice maybe with $img = imagecropauto($img); commented out a second time. I tried viewing with IrfanView 4.37 and Paint.NET 4.0.6

Test script:
$img = imagecreatetruecolor(400, 400);
imagefill($img, 0, 0, imagecolorallocate($img, 255, 255, 255)); // white background
$blue = imagecolorallocate($img, 0, 0, 255);
foreach (range(1, 5) as $font) {
  imagestring($img, $font, 10, $font * 15, 'test', $blue);
$img = imagecropauto($img);
imagepng($img, 'test.png');


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-12-25 17:42 UTC] flip101 at gmail dot com
Seems to be duplicate of
 [2016-07-23 17:58 UTC]
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2016-07-23 17:58 UTC]
Indeed a duplicate of bug #67447.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Nov 27 02:03:14 2021 UTC