php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15094 GD2 bugs
Submitted: 2002-01-18 00:02 UTC Modified: 2002-02-19 00:00 UTC
Votes:9
Avg. Score:3.9 ± 1.4
Reproduced:5 of 5 (100.0%)
Same Version:1 (20.0%)
Same OS:1 (20.0%)
From: rensx at chgc dot sh dot cn Assigned:
Status: No Feedback Package: GD related
PHP Version: 4.1.1 OS: windows98
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rensx at chgc dot sh dot cn
New email:
PHP Version: OS:

 

 [2002-01-18 00:02 UTC] rensx at chgc dot sh dot cn
When I use GD2 include in the php4.1.1 release package. The function ImageCopyResized and ImageCopyResampled give colorless output. But Gd works well.
Sincerely

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-18 10:03 UTC] sander@php.net
Can you provide a (self-contained) sample script?
 [2002-02-19 00:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2003-02-13 08:31 UTC] php at kershaw dot org
My ISP just upgraded to GD2 and I'm getting exactly the same problem. My image upload script has been running fine for months, now all uploaded images that are resized look 'washed out':
http://www2.kershaw.org/865_colourless

If I upload an image that is already small enough, ie doesn't get resized, the image looks fine.

My phpinfo below:

PHP Logo
PHP Version 4.3.0

System Linux ex1 2.4.20 #1 Thu Feb 6 11:10:32 PST 2003 i686
Build Date Feb 2 2003 13:28:02
Configure Command './configure' '--prefix=/usr/local/apache/php' '--with-config-file-path=/usr/local/lib' '--enable-xslt' '--with-xslt-sablot' '--with-mysql=/usr/local/mysql' '--with-pgsql=/usr/local/pgsql' '--enable-track-vars' '--enable-bcmath' '--enable-ftp' '--with-gd' '--enable-gd-native-tt' '--with-freetype-dir' '--with-imap=/usr/local/lib' '--with-imap-ssl' '--with-png-dir' '--with-jpeg-dir' '--with-dom=/usr/local' '--with-zlib-dir' '--enable-trans-sid' '--with-mcrypt=/usr/local' '--with-mhash=/usr/' '--with-curl' '--with-openssl=/usr/local/ssl' '--with-pspell' '--enable-memory-limit' '--with-apxs=/usr/local/apache/bin/apxs'
Server API Apache
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/lib/php.ini
PHP API 20020918
PHP Extension 20020429
Zend Extension 20021010
Debug Build no
Thread Safety disabled
Registered PHP Streams php, http, ftp, https, ftps, compress.zlib

Zend logo This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies

PHP Credits
Configuration
PHP Core
Directive Local Value Master Value
allow_call_time_pass_reference On On
allow_url_fopen On On
always_populate_raw_post_data Off Off
arg_separator.input & &
arg_separator.output & &
asp_tags Off Off
auto_append_file no value no value
auto_prepend_file no value no value
browscap no value no value
default_charset no value no value
default_mimetype text/html text/html
define_syslog_variables Off Off
disable_functions no value no value
display_errors On On
display_startup_errors Off Off
doc_root no value no value
docref_ext no value no value
docref_root http://www.php.net/ http://www.php.net/
enable_dl On On
error_append_string no value no value
error_log no value no value
error_prepend_string no value no value
error_reporting 2039 2039
expose_php On On
extension_dir ./ ./
file_uploads On On
gpc_order GPC GPC
highlight.bg #FFFFFF #FFFFFF
highlight.comment #FF9900 #FF9900
highlight.default #0000CC #0000CC
highlight.html #000000 #000000
highlight.keyword #006600 #006600
highlight.string #CC0000 #CC0000
html_errors On On
ignore_repeated_errors Off Off
ignore_repeated_source Off Off
ignore_user_abort Off Off
implicit_flush Off Off
include_path .:/usr/local/apache/php/lib/php .:/usr/local/apache/php/lib/php
log_errors Off Off
log_errors_max_len 1024 1024
magic_quotes_gpc On On
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
max_execution_time 30 30
max_input_time -1 -1
memory_limit 8M 8M
open_basedir no value no value
output_buffering no value no value
output_handler no value no value
post_max_size 8M 8M
precision 12 12
register_argc_argv On On
register_globals On On
report_memleaks On On
safe_mode Off Off
safe_mode_exec_dir no value no value
safe_mode_gid Off Off
safe_mode_include_dir no value no value
sendmail_from me@localhost.com me@localhost.com
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
short_open_tag On On
SMTP localhost localhost
smtp_port 25 25
sql.safe_mode Off Off
track_errors Off Off
unserialize_callback_func no value no value
upload_max_filesize 2M 2M
upload_tmp_dir no value no value
user_dir no value no value
variables_order EGPCS EGPCS
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
y2k_compliance Off Off

apache
APACHE_INCLUDE no value
APACHE_TARGET no value
Apache Version Apache/1.3.27
Apache Release 10327100
Apache API Version 19990320
Hostname:Port www2.ipc-homes.com:0
User/Group nobody(99)/100
Max Requests Per Child: 16 - Keep Alive: on - Max Per Connection: 100
Timeouts Connection: 400 - Keep-Alive: 15
Server Root /usr/local/apache
Loaded Modules mod_php4, mod_perl, mod_gzip, mod_frontpage, mod_setenvif, mod_so, mod_auth, mod_access, mod_rewrite, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_info, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_core

Directive Local Value Master Value
child_terminate 0 0
engine 1 1
last_modified 0 0
xbithack 0 0

Apache Environment
Variable Value
DOCUMENT_ROOT /home/kershaw/web/ipc-web
HTTP_ACCEPT text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1
HTTP_ACCEPT_ENCODING gzip, deflate, compress;q=0.9
HTTP_ACCEPT_LANGUAGE en-us, en;q=0.50
HTTP_CONNECTION keep-alive
HTTP_HOST www2.ipc-homes.com
HTTP_KEEP_ALIVE 300
HTTP_USER_AGENT Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.0.1) Gecko/20030128 Chimera/0.6+
PATH /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
REMOTE_ADDR 80.6.170.90
REMOTE_HOST pc1-leed3-5-cust90.ldst.cable.ntl.com
REMOTE_PORT 64898
SCRIPT_FILENAME /home/kershaw/web/ipc-web/phpinfo.php
SERVER_ADDR 65.117.175.103
SERVER_ADMIN webmaster@www2.ipc-homes.com
SERVER_NAME www2.ipc-homes.com
SERVER_PORT 80
SERVER_SIGNATURE no value
SERVER_SOFTWARE Apache/1.3.27 (Unix) PHP/4.3.0 mod_perl/1.27 mod_gzip/1.3.19.1a FrontPage/4.0.4.3
USER kershaw
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING no value
REQUEST_URI /phpinfo.php
SCRIPT_NAME /phpinfo.php

HTTP Headers Information
HTTP Request Headers
HTTP Request GET /phpinfo.php HTTP/1.1
Accept text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1
Accept-Encoding gzip, deflate, compress;q=0.9
Accept-Language en-us, en;q=0.50
Connection keep-alive
Host www2.ipc-homes.com
Keep-Alive 300
User-Agent Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.0.1) Gecko/20030128 Chimera/0.6+
HTTP Response Headers
X-Powered-By PHP/4.3.0
Keep-Alive timeout=15, max=100
Connection Keep-Alive
Transfer-Encoding chunked
Content-Type text/html

bcmath
BCMath support enabled

ctype
ctype functions enabled

curl
CURL support enabled
CURL Information libcurl/7.10.2 OpenSSL/0.9.7 zlib/1.1.4

domxml
DOM/XML enabled
DOM/XML API Version 20020814
libxml Version 20420
HTML Support enabled
XPath Support enabled
XPointer Support enabled

ftp
FTP support enabled

gd
GD Support enabled
GD Version bundled (2.0 compatible)
FreeType Support enabled
FreeType Linkage with freetype
GIF Read Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled

imap
IMAP c-Client Version 4.1
SSL Support enabled

mcrypt
mcrypt support enabled
version >= 2.4.x
Supported ciphers cast-128 cast-256 enigma xtea arcfour panama safer-sk64 saferplus des tripledes blowfish gost rc2 safer-sk128 threeway serpent wake loki97 rijndael-128 rijndael-192 rijndael-256 twofish blowfish-compat
Supported modes stream cbc cfb ecb ncfb ofb nofb

Directive Local Value Master Value
mcrypt.algorithms_dir no value no value
mcrypt.modes_dir no value no value

mhash
MHASH support Enabled
MHASH API Version 20001215

mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.55
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_INCLUDE -I/usr/local/mysql/include/mysql
MYSQL_LIBS -L/usr/local/mysql/lib/mysql -lmysqlclient

Directive Local Value Master Value
mysql.allow_persistent On On
mysql.connect_timeout -1 -1
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off

openssl
OpenSSL support enabled
OpenSSL Version OpenSSL 0.9.7 31 Dec 2002

overload
User-Space Object Overloading Support enabled

pcre
PCRE (Perl Compatible Regular Expressions) Support enabled
PCRE Library Version 3.92 11-Sep-2002

pgsql
PostgreSQL Support enabled
Active Persistent Links 0
Active Links 0

Directive Local Value Master Value
pgsql.allow_persistent On On
pgsql.auto_reset_persistent Off Off
pgsql.ignore_notice Off Off
pgsql.log_notice Off Off
pgsql.max_links Unlimited Unlimited
pgsql.max_persistent Unlimited Unlimited

posix
Revision $Revision: 1.51 $

pspell
PSpell Support enabled

session
Session Support enabled
Registered save handlers files user

Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 On On
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_dividend 100 100
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /tmp /tmp
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid On On

standard
Regex Library Bundled library enabled
Dynamic Library Support enabled
Path to sendmail /usr/sbin/sendmail -t -i

Directive Local Value Master Value
assert.active 1 1
assert.bail 0 0
assert.callback no value no value
assert.quiet_eval 0 0
assert.warning 1 1
auto_detect_line_endings 0 0
default_socket_timeout 60 60
safe_mode_allowed_env_vars PHP_ PHP_
safe_mode_protected_env_vars LD_LIBRARY_PATH LD_LIBRARY_PATH
url_rewriter.tags a=href,area=href,frame=src,input=src,form=fakeentry a=href,area=href,frame=src,input=src,form=fakeentry
user_agent no value no value

tokenizer
Tokenizer Support enabled

xml
XML Support active
XML Namespace Support active
EXPAT Version 1.95.2

xslt
XSLT support enabled
Backend Sablotron
Sablotron Version 0.97
Sablotron Information Cflags: -g -O2 Libs: -L/usr/local/lib -lexpat Prefix: /usr/local

zlib
ZLib Support enabled
Compiled Version 1.1.4
Linked Version 1.1.4

Directive Local Value Master Value
zlib.output_compression Off Off
zlib.output_compression_level -1 -1
zlib.output_handler no value no value

Additional Modules
Module Name

Environment
Variable Value
PWD /usr/local/apache/bin
HOSTNAME ex1
ignoreeof 10
LS_OPTIONS --color=auto -F -b -T 0
MANPATH /usr/local/man:/usr/man
LESSOPEN |lesspipe.sh %s
LESS -MM
USER root
LS_COLORS no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.bz2=01;31:*.rpm=01;31:*.deb=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.mpg=01;37:*.avi=01;37:*.mov=01;37:*.gl=01;37:*.dl=01;37:
MACHTYPE i386-slackware-linux-gnu
MAIL /var/mail/root
OLDPWD /home/altphp/web
EDITOR /usr/bin/pico
LOGNAME root
SHLVL 3
SHELL /bin/bash
HOSTTYPE i386
OSTYPE linux-gnu
HOME /root
TERM vt100
PATH /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
SSH_TTY /dev/ttyp0
_ ./httpd
LD_LIBRARY_PATH /usr/local/apache/libexec

PHP Variables
Variable Value
PHP_SELF /phpinfo.php
_SERVER["DOCUMENT_ROOT"] /home/kershaw/web/ipc-web
_SERVER["HTTP_ACCEPT"] text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1
_SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate, compress;q=0.9
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-us, en;q=0.50
_SERVER["HTTP_CONNECTION"] keep-alive
_SERVER["HTTP_HOST"] www2.ipc-homes.com
_SERVER["HTTP_KEEP_ALIVE"] 300
_SERVER["HTTP_USER_AGENT"] Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.0.1) Gecko/20030128 Chimera/0.6+
_SERVER["PATH"] /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
_SERVER["REMOTE_ADDR"] 80.6.170.90
_SERVER["REMOTE_HOST"] pc1-leed3-5-cust90.ldst.cable.ntl.com
_SERVER["REMOTE_PORT"] 64898
_SERVER["SCRIPT_FILENAME"] /home/kershaw/web/ipc-web/phpinfo.php
_SERVER["SERVER_ADDR"] 65.117.175.103
_SERVER["SERVER_ADMIN"] webmaster@www2.ipc-homes.com
_SERVER["SERVER_NAME"] www2.ipc-homes.com
_SERVER["SERVER_PORT"] 80
_SERVER["SERVER_SIGNATURE"] no value
_SERVER["SERVER_SOFTWARE"] Apache/1.3.27 (Unix) PHP/4.3.0 mod_perl/1.27 mod_gzip/1.3.19.1a FrontPage/4.0.4.3
_SERVER["USER"] kershaw
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["SERVER_PROTOCOL"] HTTP/1.1
_SERVER["REQUEST_METHOD"] GET
_SERVER["QUERY_STRING"] no value
_SERVER["REQUEST_URI"] /phpinfo.php
_SERVER["SCRIPT_NAME"] /phpinfo.php
_SERVER["PATH_TRANSLATED"] /home/kershaw/web/ipc-web/phpinfo.php
_SERVER["PHP_SELF"] /phpinfo.php
_SERVER["argv"]

Array
(
)

_SERVER["argc"] 0
_ENV["PWD"] /usr/local/apache/bin
_ENV["HOSTNAME"] ex1
_ENV["ignoreeof"] 10
_ENV["LS_OPTIONS"] --color=auto -F -b -T 0
_ENV["MANPATH"] /usr/local/man:/usr/man
_ENV["LESSOPEN"] |lesspipe.sh %s
_ENV["LESS"] -MM
_ENV["USER"] root
_ENV["LS_COLORS"] no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.bz2=01;31:*.rpm=01;31:*.deb=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.mpg=01;37:*.avi=01;37:*.mov=01;37:*.gl=01;37:*.dl=01;37:
_ENV["MACHTYPE"] i386-slackware-linux-gnu
_ENV["MAIL"] /var/mail/root
_ENV["OLDPWD"] /home/altphp/web
_ENV["EDITOR"] /usr/bin/pico
_ENV["LOGNAME"] root
_ENV["SHLVL"] 3
_ENV["SHELL"] /bin/bash
_ENV["HOSTTYPE"] i386
_ENV["OSTYPE"] linux-gnu
_ENV["HOME"] /root
_ENV["TERM"] vt100
_ENV["PATH"] /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
_ENV["SSH_TTY"] /dev/ttyp0
_ENV["_"] ./httpd
_ENV["LD_LIBRARY_PATH"] /usr/local/apache/libexec

PHP License

This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.
 [2003-07-28 04:08 UTC] php_A at T_nospam_pwoods dot fsnet dot co dot uk
Similar problem for me - I didn't realise it at first but my ISP upgraded the whole server package.  I investigated on my Windows 2003 box and this is what I found...
Images worked fine with the extension gd.dll enabled, gd2.dll disabled, but the other way around (gd2 enabled) all images were washy.

Am about to re-do my thumbnail script to take advantage of imagecopyresampled and imagecreatetruecolor to see if that changes things!!
 [2003-07-28 04:27 UTC] php_A at T_nospam_pwoods dot fsnet dot co dot uk
Using imagecreatetruecolor and then imagecopyresampled works perfectly - if you are experiencing this bug, change your code to use these newer functions - the thumbnails generated will be of better quality as well!!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 13:01:30 2024 UTC