Bug #75072 [NEW]: imagepng does not produce lossless output when input is lossy

From: Date: Sun, 13 Aug 2017 19:01:16 +0000
Subject: Bug #75072 [NEW]: imagepng does not produce lossless output when input is lossy
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210659@lists.php.net to get a copy of this message
From: choinnn1 at gmail dot com Operating system: Windows 8.1 PHP version: 7.1.8 Package: GD related Bug Type: Bug Bug description:imagepng does not produce lossless output when input is lossy Description: ------------ 1. Save image: http://www.softaculous.com/blog/wp-content/uploads/2013/04/php-logo.jpeg as php-logo.jpeg 2. Open php-logo.jpeg in Windows Paint, save as php-logo_paint.png 3. Write a script in PHP to convert php-logo.jpeg into php-logo_php.png Test script: --------------- imagepng(imagecreatefromjpeg('C:\php-logo.jpg'), 'C:\php-logo_php.png'); Expected result: ---------------- php-logo_php.png should be visually 100% identical to both php-logo.jpeg and php-logo_paint.png. Actual result: -------------- php-logo_php.png contains slightly different colors when compared to php-logo.jpeg and php-logo_paint.png. See the diff (made with Beyond Compare): php-logo.jpeg vs php-logo_php.png: http://i.imgur.com/0nY42bF.png php-logo.jpeg vs php-logo_paint.png: http://i.imgur.com/sjgyHAE.png Note: php-logo_paint.png is 32-bit PNG image by default for me, but it's not relevant. If I convert it to 24-bit PNG or use Paint.NET instead of Microsoft Paint from the start, the result will be the same. -- Edit bug report at https://bugs.php.net/bug.php?id=75072&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75072&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75072&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75072&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75072&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75072&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75072&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75072&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75072&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75072&r=support Expected behavior: https://bugs.php.net/fix.php?id=75072&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75072&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75072&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75072&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75072&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75072&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75072&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75072&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75072&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75072&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75072&r=mysqlcfg

« previous php.bugs (#210659) next »