Bug #70102 [NEW]: imagecreatefromwebm() shifts colors

From: Date: Sun, 19 Jul 2015 17:32:46 +0000
Subject: Bug #70102 [NEW]: imagecreatefromwebm() shifts colors
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194558@lists.php.net to get a copy of this message
From:             cmb
Operating system: *
PHP version:      5.6.11
Package:          GD related
Bug Type:         Bug
Bug description:imagecreatefromwebm() shifts colors

Description:
------------
When reading images with imagecreatefromwebp() all colors are
shifted.

This issue has already been reported upstream against libgd:
<https://github.com/libgd/libgd/issues/83>.

Test script:
---------------
<?php
$im = imagecreatetruecolor(8, 8);
$white = imagecolorallocate($im, 0xff, 0xaa, 0x55);
echo sprintf("%08x\n", $white);
imagefilledrectangle($im, 0, 0, 74, 74, $white);
imagewebp($im, 'test.webp');
imagedestroy($im);

$im = imagecreatefromwebp('test.webp');
echo sprintf("%08x\n", imagecolorat($im, 4, 4));
imagepng($im, 'test.png');
?>


Expected result:
----------------
00ffaa55
00ffaa55

Actual result:
--------------
00ffaa55
ffab5500

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



Thread (3 messages)

« previous php.bugs (#194558) next »