php.net |  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
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: cmb@php.net Assigned: cmb (profile)
Status: Closed Package: GD related
PHP Version: master-Git-2016-10-10 (Git) OS: *
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cmb@php.net
New email:
PHP Version: OS:

 

 [2016-10-10 11:07 UTC] cmb@php.net
Description:
------------
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] <https://github.com/libgd/libgd/issues/329>


Test script:
---------------
<?php

$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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-01-10 15:29 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=6b4cdbaade1b077e8f0eceecb0e07921fed00aff
Log: Fix #73281: imagescale(…, IMG_BILINEAR_FIXED) can cause black border
 [2019-01-10 15:29 UTC] cmb@php.net
-Status: Open +Status: Closed
 [2019-01-10 15:30 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 11:01:29 2024 UTC