From:             php at lucard dot nl
Operating system: Linux
PHP version:      4.4.1
PHP Bug Type:     GD related
Bug description:  filecreation with imagepng or imagejpg fails

Description:
------------
When you create an image with imagepng or imagejpeg it fails. Displaying
the error message: 
Warning: imagepng(): Unable to access test.png in
/opt/guide/mydomain/HTML3/test/1.php on line 6
Warning: imagepng(): Invalid filename 'test.png' in
/opt/guide/mydomain/HTML3/test/1.php on line 6

The rights on the directory are open ( 777 ), with other functions we are
able to write to the directory.

configline:
./configure' '--prefix=/usr/local/php4'
'--with-apxs2=/usr/local/apache2/bin/apxs' '--disable-cgi'
'--enable-safe-mode' '--with-openssl=/usr/local/ssl' '--with-pear'
'--with-zlib' '--with-gettext' '--with-iconv=/usr' '--with-iconv-dir=/usr'
'--enable-bcmath' '--enable-sockets' '--enable-calendar'
'--enable-mbstring=all' '--enable-mbregex' '--with-curl=/usr/local'
'--enable-dba' '--enable-dbase' '--with-dom=/usr/local'
'--with-dom-xslt=/usr/local' '--with-dom-exslt=/usr/local' '--with-xmlrpc'
'--enable-ftp' '--with-gd' '--with-jpeg-dir' '--with-png-dir' '--with-ttf'
'--with-freetype-dir=/usr' '--enable-gd-native-ttf'
'--with-imap=../imap-2004g' '--with-imap-ssl=/usr/local/ssl' '--with-ldap'
'--with-mcrypt=/usr/local' '--with-mime-magic' '--with-mhash=/usr/local'
'--with-mysql=/usr/local/mysql' '--with-pgsql=/usr/local/pgsql'
'--with-pdflib=/usr/local' '--with-swf=../swf/dist/' '--enable-wddx'
'--enable-xslt' '--with-xslt-sablot=/usr/local' '--with-expat'
'--with-expat-dir=/usr/local' '--enable-exif' '--with-bz2' '--with-zip'
'--enable-memory-limit'


Reproduce code:
---------------
error_reporting(E_ALL);
$destImage = imageCreateTrueColor(100, 200);
// the code works if we remove the comment before the touch
//touch("test.png");
imagepng($destImage,"test.png");



Expected result:
----------------
Nothing, the image should have been created in the current directory.

It works if we create the file first with the touch!

Actual result:
--------------
Warning: imagepng(): Unable to access test.png in
/opt/guide/mydomain/HTML3/test/1.php on line 6
Warning: imagepng(): Invalid filename 'test.png' in
/opt/guide/mydomain/HTML3/test/1.php on line 6

-- 
Edit bug report at http://bugs.php.net/?id=35246&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=35246&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=35246&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=35246&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=35246&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=35246&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=35246&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=35246&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=35246&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=35246&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=35246&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=35246&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=35246&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=35246&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=35246&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=35246&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=35246&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=35246&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=35246&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=35246&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=35246&r=mysqlcfg

Reply via email to