php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15360 The Function ImageCreateFromPNG lose some colors
Submitted: 2002-02-03 16:19 UTC Modified: 2002-02-10 11:05 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: dirk dot schaeck at system-interface dot de Assigned:
Status: Not a bug Package: GD related
PHP Version: 4.0.6 / 4.1.1 OS: Linux
Private report: No CVE-ID: None
 [2002-02-03 16:19 UTC] dirk dot schaeck at system-interface dot de
Hello,

i get a png image whith more than 16 color whith the function ImageCreateFromPNG and i send it to the Browser.

If i compare the color from the original and from the Picture on browser i see the first 16 color correctly but the next colors behind are a repeating colorset. ( i think this are the default color from the gd lib).

thanks 


dirk

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-04 10:41 UTC] sander@php.net
Which version of GD are you using?
If your PNG contains 'true colors', GD 1.x can't handle them.
 [2002-02-04 16:33 UTC] dirk dot schaeck at system-interface dot de
Sorry i thinkit is a 4.1,1 but here the current Infos

PHP Version 4.0.6
Linux sa-webpack.one-2-one.net 2.2.19-6.2.1 #1 Mon Apr 9 22:24:58 EDT 2001 i586 unknown
 './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-mysql=/usr/local/phplibs/' '--with-gd=/usr/local/phplibs/' '--enable-track-vars' '--with-jpeg-dir=/usr/local/phplibs/lib' '--enable-versioning' '--with-imap=/usr/local/phplibs/' '--enable-ftp' '--with-mcrypt=/usr/local/phplibs/' '--with-zlib=/usr/local/phplibs/' '--with-swf=/usr/local/phplibs/' '--with-xml' '--with-recode=/usr/local/phplibs/' '--with-config-file-path=/usr/local/phplibs/ini/' '--with-gdbm=/usr/local/phplibs/' '--with-ndbm=/usr/local/phplibs/' '--enable-dbase' '--enable-bcmath' '--enable-memory-limit' '--enable-trans-sid' '--with-ttf=/usr/local/phplibs/' '--enable-gd-native-ttf' '--with-png-dir=/usr/local/phplibs/'

GD Support enabled 
GD Version 1.6.2 or higher 
FreeType Support enabled 
FreeType Linkage with TTF library 
JPG Support enabled 
PNG Support enabled 
WBMP Support enabled 

i think thats all what u need

thankx 


dirk schaeck
 [2002-02-10 11:01 UTC] dirk dot schaeck at system-interface dot de
I Have test the script whith a 4.1.1 and NT5.0 my GD libinfo

GD Support enabled 
GD Version 1.6.2 or higher 
FreeType Support enabled 
FreeType Linkage with TTF library 
JPG Support enabled 
PNG Support enabled 
WBMP Support enabled 

the script is here ....
<?
// File open
$im = imagecreatefrompng("test.png"); /* Attempt to open */

// send image
Header("Content-type: image/jpeg");
ImagePNG($im);           //Send pic to browser
?>
 [2002-02-10 11:05 UTC] derick@php.net
Not a bug, but a limitation in the GD 1.x library. You shoudl upgrade your GD to 2.x if you want to use true color PNGs.

Derick
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 08:01:30 2024 UTC