Bug #81321 [Opn]: incorrect image on save

From: Date: Mon, 02 Aug 2021 08:00:07 +0000
Subject: Bug #81321 [Opn]: incorrect image on save
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235520@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81321&edit=1

 ID:                 81321
 User updated by:    andrei at anleaf dot com
 Reported by:        andrei at anleaf dot com
 Summary:            incorrect image on save
 Status:             Open
 Type:               Bug
 Package:            *Graphics related
 Operating System:   CentOs 7.9
 PHP Version:        7.4.22
 Block user comment: N
 Private report:     N

 New Comment:

One more png with the problem
https://www.dropbox.com/s/1kuirhjgvnfcohs/logo_orig-2.png?dl=0

Its conversion result (wrong) is here
https://www.dropbox.com/s/98iklpacpm5ppot/logo-orig-2_new.png?dl=0


Previous Comments:
------------------------------------------------------------------------
[2021-08-01 21:30:16] andrei at anleaf dot com

Description:
------------
problem with opening and saving some png images using imagecreatefrompng() and then save it using
imagepng($image,$file).
Image opens OK but when saved, the resulting image has broken alpha channel.
Happens with some png images.

Input image to test is here https://www.dropbox.com/s/c6ne72bobrt2iz9/logo_orig.png?dl=0

Resulting image with problem is here https://www.dropbox.com/s/xs4b4bv6208hiua/logo_new.png?dl=0


Test script:
---------------
$im = imagecreatefrompng("logo_orig.png");
imagepng($im,"logo_new.png");
imagedestroy($im);

Expected result:
----------------
saved image should look the same as an input image

Actual result:
--------------
saved image is completely distorted.


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=81321&edit=1


Thread (3 messages)

« previous php.bugs (#235520) next »