#20866 [Opn->Bgs]: Wrong XPM format

From: Date: Sat, 07 Dec 2002 00:32:33 +0000
Subject: #20866 [Opn->Bgs]: Wrong XPM format
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-26893@lists.php.net to get a copy of this message
ID: 20866 Updated by: sniper@php.net Reported By: gilles_gros@yahoo.com -Status: Open +Status: Bogus Bug Type: GD related Operating System: linux PHP Version: 4CVS-2002-12-06 (stable) New Comment: GD bug, not PHP bug. Report it to the GD author. Previous Comments: ------------------------------------------------------------------------ [2002-12-06 12:29:18] gilles_gros@yahoo.com This is a follow-up on bug 20839. The XPM format is now supported in the GD extension :) I have noticed that some XPM icons are not properly converted to PNG. My analysis of the problem is that when the color definition is : static char * XPM_icon[] = { /* width height ncolors cpp [x_hot y_hot] */ "32 32 9 1 -1 -1", /* colors */ " c #DEDEDFDFDEDE", ". c #212120202121", "X c #737371717373", "o s iconColor1 m black c black", "O s iconColor6 m white c yellow", "+ s iconColor4 m white c green", "@ c #ADADAEAEADAD", "# c #636361616363", "$ s iconColor3 m black c red", /* pixels */ ... the color conversion is not right. I do not know if it is GD or the use of GD in PHP that is not doing the right work. But if you have the color definition like : static char * XPM_icon[] = { /* width height ncolors cpp [x_hot y_hot] */ "32 32 9 1 -1 -1", /* colors */ " c #DEDEDFDFDEDE", ". c #212120202121", "X c #737371717373", "o c #000000000000", "O c #FFFFFFFF0000", "+ c #0000FFFF0000", "@ c #ADADAEAEADAD", "# c #636361616363", "$ c #FFFF00000000", /* pixels */ ... everything is fine. Hope this will help make gd extension better. Here are 2 XPMs. ======= XPM color wrong : static char * app_php_http_gwy[] = { /* width height ncolors cpp [x_hot y_hot] */ "32 32 9 1 -1 -1", /* colors */ " c #DEDEDFDFDEDE", ". c #212120202121", "X c #737371717373", "o s iconColor1 m black c black", "O s iconColor6 m white c yellow", "+ s iconColor4 m white c green", "@ c #ADADAEAEADAD", "# c #636361616363", "$ s iconColor3 m black c red", /* pixels */ " ", " ........ ", " X...... ", " X X Xo ", " XOXXXXOX Xoo ", " XOOOOOOOOX X o ", " XOOOOOOOOOOX oo ", "X++++++++++++XXo X @ ", "#++++++++++++X Xoo XO@@XXXO@ ", " #$$$$$$$$$$X X o XOOOOOOOOO@ ", " #$$$$$$$$X oo #OOOOOOOOOOO@", " #$####$X Xo #OOOOOOOOOX ", " # X Xoo #O#####OX ", " XOXXXXOX X o # @ ", " XOOOOOOOOX oo X+@@XXX+@ ", " XOOOOOOOOOOX Xo X+++++++++@ ", "X++++++++++++X Xoo #+++++++++++@", "#++++++++++++X X o #+++++++++X ", " #$$$$$$$$$$X oo #+#####+X ", " #$$$$$$$$X Xo # @ ", " #$####$X Xoo X$@@XXX$@ ", " # X X o X$$$$$$$$$@ ", " XOXXXXOX oo #$$$$$$$$$$$@", " XOOOOOOOOX Xo #$$$$$$$$$X ", " XOOOOOOOOOOX Xoo #$#####$X ", "X++++++++++++X X o # # ", "#++++++++++++X oo ", " #$$$$$$$$$$X Xo ", " #$$$$$$$$X Xoo ", " #$####$X X o ", " # X oooooo ", " ........ "}; ======================================== XPM color right : static char * app_php_http_gwy[] = { /* width height ncolors cpp [x_hot y_hot] */ "32 32 9 1 -1 -1", /* colors */ " c #DEDEDFDFDEDE", ". c #212120202121", "X c #737371717373", "o c #000000000000", "O c #FFFFFFFF0000", "+ c #0000FFFF0000", "@ c #ADADAEAEADAD", "# c #636361616363", "$ c #FFFF00000000", /* pixels */ " ", " ........ ", " X...... ", " X X Xo ", " XOXXXXOX Xoo ", " XOOOOOOOOX X o ", " XOOOOOOOOOOX oo ", "X++++++++++++XXo X @ ", "#++++++++++++X Xoo XO@@XXXO@ ", " #$$$$$$$$$$X X o XOOOOOOOOO@ ", " #$$$$$$$$X oo #OOOOOOOOOOO@", " #$####$X Xo #OOOOOOOOOX ", " # X Xoo #O#####OX ", " XOXXXXOX X o # @ ", " XOOOOOOOOX oo X+@@XXX+@ ", " XOOOOOOOOOOX Xo X+++++++++@ ", "X++++++++++++X Xoo #+++++++++++@", "#++++++++++++X X o #+++++++++X ", " #$$$$$$$$$$X oo #+#####+X ", " #$$$$$$$$X Xo # @ ", " #$####$X Xoo X$@@XXX$@ ", " # X X o X$$$$$$$$$@ ", " XOXXXXOX oo #$$$$$$$$$$$@", " XOOOOOOOOX Xo #$$$$$$$$$X ", " XOOOOOOOOOOX Xoo #$#####$X ", "X++++++++++++X X o # # ", "#++++++++++++X oo ", " #$$$$$$$$$$X Xo ", " #$$$$$$$$X Xoo ", " #$####$X X o ", " # X oooooo ", " ........ "}; ====================== ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20866&edit=1

« previous php.bugs (#26893) next »