php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15962 ImageType() Not Returning IMG_GIF
Submitted: 2002-03-08 13:06 UTC Modified: 2002-03-08 14:29 UTC
From: ryan at starbak dot net Assigned:
Status: Closed Package: GD related
PHP Version: 4.1.2 OS: Linux 2.2.12-4 sparc64
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: ryan at starbak dot net
New email:
PHP Version: OS:

 

 [2002-03-08 13:06 UTC] ryan at starbak dot net
EXAMPLE SCRIPT:

if (ImageTypes() & IMG_PNG) {
    Header("Content-Type: image/png");
    ImagePNG($im_out);
} elseif (ImageTypes() & IMG_GIF) {
    Header("Content-Type: image/gif");
    ImageGIF($im_out);
} elseif (ImageTypes() & IMG_JPG) {
    Header("Content-Type: image/jpeg");
    ImageJPEG($im_out);
} else {
    Header("Content-Type: image/gif");
    ImageGIF($im_out);
    syslog(LOG_WARNING,"($user[username]) $REMOTE_ADDR could not find php-spported image.  (no libgd?)");
}

BUG DESCRIPTION:

This script (i cut the beginning of it off), instead of running the second statement - elseif (ImageTypes() & IMG_GIF) instead runs the *last* statement.  Yet, it still displays the GIF perfectly.... (originally the final case else just did a syslog and did not display anything... I put that Header and ImageGIF there when it was getting to that final else even when I had IMG_GIF support).  phpinfo reports that I do have GIF support, so I don't understand why ImageTypes() & IMG_GIF would be coming up false.

Thanks.

PHPINFO:
PHP Version 4.1.2 

System Linux candy 2.2.12-42 #1 Fri Nov 12 13:03:33 EST 1999 sparc64 unknown 
Build Date Feb 28 2002 
Configure Command  './configure' '--with-apache=../apache_1.3.20' '--enable-track-vars' '--prefix=/opt/www' '--with-mysql=/opt/mysql' '--enable-trans-sid' '--with-config-file-path=/opt/www/conf' '--with-zlib' '--with-gd' '--with-png-dir' 
Server API Apache 
Virtual Directory Support disabled 
Configuration File (php.ini) Path /opt/www/conf/php.ini 
ZEND_DEBUG disabled 
Thread Safety disabled 

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


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

Configuration
PHP Core 
Directive Local Value Master Value 
allow_call_time_pass_reference
 On On 
allow_url_fopen
 1 1 
always_populate_raw_post_data
 0 0 
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
 Off Off 
display_startup_errors
 Off Off 
doc_root
 no value no value 
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
 Off Off 
extension_dir
 ./ ./ 
file_uploads
 1 1 
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_user_abort
 Off Off 
implicit_flush
 Off Off 
include_path
 .:/opt/www/lib/php .:/opt/www/lib/php 
log_errors
 Off Off 
magic_quotes_gpc
 On On 
magic_quotes_runtime
 Off Off 
magic_quotes_sybase
 Off Off 
max_execution_time
 30 30 
open_basedir
 no value no value 
output_buffering
 no value no value 
output_handler
 no value no value 
post_max_size
 8M 8M 
precision
 14 14 
register_argc_argv
 On On 
register_globals
 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 
sql.safe_mode
 Off Off 
track_errors
 Off Off 
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 


xml
XML Support active 
XML Namespace Support active 
EXPAT Version 1.95.2 


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 
safe_mode_allowed_env_vars
 PHP_ PHP_ 
safe_mode_protected_env_vars
 LD_LIBRARY_PATH LD_LIBRARY_PATH 
session.use_trans_sid
 1 1 
url_rewriter.tags
 a=href,area=href,frame=src,input=src,form=fakeentry a=href,area=href,frame=src,input=src,form=fakeentry 


session
Session Support enabled 

Directive Local Value Master Value 
session.auto_start
 Off Off 
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_maxlifetime
 1800 1800 
session.gc_probability
 100 100 
session.name
 ID ID 
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 


posix
Revision $Revision: 1.33.2.1 $ 


pcre
PCRE (Perl Compatible Regular Expressions) Support enabled 
PCRE Library Version 3.4 22-Aug-2000 


mysql
MySQL Support enabled 
Active Persistent Links 1 
Active Links 1 
Client API version 3.23.41 
MYSQL_MODULE_TYPE external 
MYSQL_SOCKET /tmp/mysql.sock 
MYSQL_INCLUDE -I/opt/mysql/include/mysql 
MYSQL_LIBS -L/opt/mysql/lib/mysql -lmysqlclient -L/usr/lib -z 

Directive Local Value Master Value 
mysql.allow_persistent
 On On 
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 


gd
GD Support enabled 
GD Version between 1.3 and 1.6.1 
GIF Read Support enabled 
GIF Create Support enabled 


zlib
ZLib Support enabled 
'zlib:' fopen wrapper enabled 
Compiled Version 1.1.3 
Linked Version 1.1.3 


apache
APACHE_INCLUDE   
APACHE_TARGET   
Apache Version Apache/1.3.20 
Apache Release 10320100 
Apache API Version 19990320 
Hostname:Port h118.starbak.net:80 
User/Group nobody(99)/99 
Max Requests Per Child: 0 - Keep Alive: on - Max Per Connection: 100 
Timeouts Connection: 300 - Keep-Alive: 15 
Server Root /opt/www 
Loaded Modules mod_asf, mod_php4, mod_ssl, 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_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 /opt/www/htdocs/catalog 
HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-mediadna-xdna, application/x-mediadna-mdna, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */* 
HTTP_ACCEPT_ENCODING gzip, deflate 
HTTP_ACCEPT_LANGUAGE en-us 
HTTP_CONNECTION Keep-Alive 
HTTP_COOKIE administrator_redial=a%3A9%3A%7Bs%3A9%3A%22call_name%22%3Bs%3A7%3A%22Default%22%3Bs%3A11%3A%22call_number%22%3Bs%3A12%3A%2263.144.91.22%22%3Bs%3A12%3A%22call_bitrate%22%3Bs%3A3%3A%22512%22%3Bs%3A11%3A%22call_format%22%3Bs%3A1%3A%222%22%3Bs%3A10%3A%22slidesetid%22%3Bs%3A1%3A%220%22%3Bs%3A14%3A%22record_options%22%3Bs%3A1%3A%220%22%3Bs%3A13%3A%22security_live%22%3Bs%3A1%3A%221%22%3Bs%3A15%3A%22security_replay%22%3Bs%3A1%3A%221%22%3Bs%3A17%3A%22security_password%22%3BN%3B%7D 
HTTP_HOST h118 
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461) 
PATH /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin 
REMOTE_ADDR 63.144.91.91 
REMOTE_PORT 3503 
SCRIPT_FILENAME /opt/www/htdocs/catalog/phpinfo.php 
SCRIPT_URI http://h118.starbak.net/phpinfo.php 
SCRIPT_URL /phpinfo.php 
SERVER_ADDR 63.144.91.118 
SERVER_ADMIN root@HOSTNAME 
SERVER_NAME h118.starbak.net 
SERVER_PORT 80 
SERVER_SIGNATURE <ADDRESS>Apache/1.3.20 Server at h118.starbak.net Port 80</ADDRESS>
 
SERVER_SOFTWARE Apache/1.3.20 (Unix) mod_ssl/2.8.4 OpenSSL/0.9.6b 
GATEWAY_INTERFACE CGI/1.1 
SERVER_PROTOCOL HTTP/1.1 
REQUEST_METHOD GET 
QUERY_STRING   
REQUEST_URI /phpinfo.php 
SCRIPT_NAME /phpinfo.php 


HTTP Headers Information
HTTP Request Headers 
HTTP Request GET /phpinfo.php HTTP/1.1 
Accept image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-mediadna-xdna, application/x-mediadna-mdna, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */* 
Accept-Encoding gzip, deflate 
Accept-Language en-us 
Connection Keep-Alive 
Cookie administrator_redial=a%3A9%3A%7Bs%3A9%3A%22call_name%22%3Bs%3A7%3A%22Default%22%3Bs%3A11%3A%22call_number%22%3Bs%3A12%3A%2263.144.91.22%22%3Bs%3A12%3A%22call_bitrate%22%3Bs%3A3%3A%22512%22%3Bs%3A11%3A%22call_format%22%3Bs%3A1%3A%222%22%3Bs%3A10%3A%22slidesetid%22%3Bs%3A1%3A%220%22%3Bs%3A14%3A%22record_options%22%3Bs%3A1%3A%220%22%3Bs%3A13%3A%22security_live%22%3Bs%3A1%3A%221%22%3Bs%3A15%3A%22security_replay%22%3Bs%3A1%3A%221%22%3Bs%3A17%3A%22security_password%22%3BN%3B%7D 
Host h118 
User-Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461) 
HTTP Response Headers 
Keep-Alive timeout=15, max=100 
Connection Keep-Alive 
Transfer-Encoding chunked 
Content-Type text/html 


Additional Modules


Environment
Variable Value 
INIT_VERSION sysvinit-2.77 
previous N 
TERM linux 
HOSTTYPE sparc 
PATH /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin 
CONSOLE /dev/console 
HOME / 
PREVLEVEL N 
RUNLEVEL 3 
SHELL /bin/bash 
runlevel 3 
OSTYPE Linux 
SHLVL 2 
_ /opt/www/bin/httpd 


PHP Variables
Variable Value 
PHP_SELF /phpinfo.php 
_COOKIE["administrator_redial"] a:9:{s:9:\"call_name\";s:7:\"Default\";s:11:\"call_number\";s:12:\"63.144.91.22\";s:12:\"call_bitrate\";s:3:\"512\";s:11:\"call_format\";s:1:\"2\";s:10:\"slidesetid\";s:1:\"0\";s:14:\"record_options\";s:1:\"0\";s:13:\"security_live\";s:1:\"1\";s:15:\"security_replay\";s:1:\"1\";s:17:\"security_password\";N;}  
_SERVER["DOCUMENT_ROOT"] /opt/www/htdocs/catalog  
_SERVER["HTTP_ACCEPT"] image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-mediadna-xdna, application/x-mediadna-mdna, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*  
_SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate  
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-us  
_SERVER["HTTP_CONNECTION"] Keep-Alive  
_SERVER["HTTP_COOKIE"] administrator_redial=a%3A9%3A%7Bs%3A9%3A%22call_name%22%3Bs%3A7%3A%22Default%22%3Bs%3A11%3A%22call_number%22%3Bs%3A12%3A%2263.144.91.22%22%3Bs%3A12%3A%22call_bitrate%22%3Bs%3A3%3A%22512%22%3Bs%3A11%3A%22call_format%22%3Bs%3A1%3A%222%22%3Bs%3A10%3A%22slidesetid%22%3Bs%3A1%3A%220%22%3Bs%3A14%3A%22record_options%22%3Bs%3A1%3A%220%22%3Bs%3A13%3A%22security_live%22%3Bs%3A1%3A%221%22%3Bs%3A15%3A%22security_replay%22%3Bs%3A1%3A%221%22%3Bs%3A17%3A%22security_password%22%3BN%3B%7D  
_SERVER["HTTP_HOST"] h118  
_SERVER["HTTP_USER_AGENT"] Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461)  
_SERVER["PATH"] /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin  
_SERVER["REMOTE_ADDR"] 63.144.91.91  
_SERVER["REMOTE_PORT"] 3503  
_SERVER["SCRIPT_FILENAME"] /opt/www/htdocs/catalog/phpinfo.php  
_SERVER["SCRIPT_URI"] http://h118.starbak.net/phpinfo.php  
_SERVER["SCRIPT_URL"] /phpinfo.php  
_SERVER["SERVER_ADDR"] 63.144.91.118  
_SERVER["SERVER_ADMIN"] root@HOSTNAME  
_SERVER["SERVER_NAME"] h118.starbak.net  
_SERVER["SERVER_PORT"] 80  
_SERVER["SERVER_SIGNATURE"] <ADDRESS>Apache/1.3.20 Server at h118.starbak.net Port 80</ADDRESS>
  
_SERVER["SERVER_SOFTWARE"] Apache/1.3.20 (Unix) mod_ssl/2.8.4 OpenSSL/0.9.6b  
_SERVER["GATEWAY_INTERFACE"] CGI/1.1  
_SERVER["SERVER_PROTOCOL"] HTTP/1.1  
_SERVER["REQUEST_METHOD"] GET  
_SERVER["QUERY_STRING"]   
_SERVER["REQUEST_URI"] /phpinfo.php  
_SERVER["SCRIPT_NAME"] /phpinfo.php  
_SERVER["PATH_TRANSLATED"] /opt/www/htdocs/catalog/phpinfo.php  
_SERVER["PHP_SELF"] /phpinfo.php  
_SERVER["argv"] Array
(
)

  
_SERVER["argc"] 0  
_ENV["INIT_VERSION"] sysvinit-2.77  
_ENV["previous"] N  
_ENV["TERM"] linux  
_ENV["HOSTTYPE"] sparc  
_ENV["PATH"] /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin  
_ENV["CONSOLE"] /dev/console  
_ENV["HOME"] /  
_ENV["PREVLEVEL"] N  
_ENV["RUNLEVEL"] 3  
_ENV["SHELL"] /bin/bash  
_ENV["runlevel"] 3  
_ENV["OSTYPE"] Linux  
_ENV["SHLVL"] 2  
_ENV["_"] /opt/www/bin/httpd  


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-08 14:29 UTC] sander@php.net
This has already been fixed in CVS.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 24 08:01:30 2024 UTC