Bug #73281 [NEW]: imagescale(…, IMG_BILINEAR_FIXED) can cause black border

From: Date: Mon, 10 Oct 2016 11:07:31 +0000
Subject: Bug #73281 [NEW]: imagescale(…, IMG_BILINEAR_FIXED) can cause black border
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204579@lists.php.net to get a copy of this message
From:             cmb
Operating system: *
PHP version:      master-Git-2016-10-10 (Git)
Package:          GD related
Bug Type:         Bug
Bug description:imagescale(…, IMG_BILINEAR_FIXED) can cause black border

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

-- 
Edit bug report at https://bugs.php.net/bug.php?id=73281&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=73281&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=73281&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=73281&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=73281&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=73281&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=73281&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=73281&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=73281&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=73281&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=73281&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=73281&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=73281&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=73281&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73281&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=73281&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=73281&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=73281&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73281&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=73281&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=73281&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#204579) next »