|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73281 imagescale(…, IMG_BILINEAR_FIXED) can cause black border
Submitted: 2016-10-10 11:07 UTC Modified: 2019-01-10 15:30 UTC
Avg. Score:3.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: Assigned: cmb (profile)
Status: Closed Package: GD related
PHP Version: master-Git-2016-10-10 (Git) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2016-10-10 11:07 UTC]
When upscaling a completely white image with the interpolation
method IMG_BILINEAR_FIXED, the resulting image has a black border
at the bottom.

This has been reported against upstream libgd[1], but as PHP's
bundled libgd is also affected, I'm forwarding.

[1] <>

Test script:

$src = imagecreatetruecolor(100, 100);
$expected = 0xffffff;
imagefilledrectangle($src, 0,0, 99,99, $expected);
$dst = imagescale($src, 200, 200, IMG_BILINEAR_FIXED);
printf("color: %x", imagecolorat($dst, 199, 199));

Expected result:
color: ffffff

Actual result:
color: 5f7f7f7f


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-01-10 15:29 UTC]
Automatic comment on behalf of
Log: Fix #73281: imagescale(…, IMG_BILINEAR_FIXED) can cause black border
 [2019-01-10 15:29 UTC]
-Status: Open +Status: Closed
 [2019-01-10 15:30 UTC]
-Assigned To: +Assigned To: cmb
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 25 09:01:29 2024 UTC