#29594 [Opn->Csd]: imagegif gives warning "Unable to open temporary file "
| From: | iliaa@php.net | Date: | Mon, 16 Aug 2004 23:09:13 +0000 |
| Subject: | #29594 [Opn->Csd]: imagegif gives warning "Unable to open temporary file " | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-64742@lists.php.net to get a copy of this message | ||
ID: 29594
Updated by: iliaa@php.net
Reported By: jbrady at sbccd dot cc dot ca dot us
-Status: Open
+Status: Closed
Bug Type: GD related
Operating System: Windows XP,2003
PHP Version: 5CVS-2004-08-10 (dev)
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2004-08-16 20:54:34] jbrady at sbccd dot cc dot ca dot us
Did some testing today. The tmpname support works fine (writes to the
c:\windows\temp directory just fine). I used it to create a temporary
file, and used imagegif to write to it, then outputed the image, and it
worked fine. It seems it just can't create the file on its own (when you
omit the optional file parameter).
Code used in this test:
$strFileName = "http://static.php.net/www.php.net/images/php.gif";
$image = imageCreateFromGif($strFileName);
if(is_resource($image)) {
$tmpfname = tempnam("","");
// NOTE:
// Required to get a picture on Netscape
// Comment out to get Error messages
header("Content-type: image/gif");
// END NOTE
imagegif($image,$tmpfname);
imageDestroy($image);
$string = file_get_contents($tmpfname);
unlink($tmpfname);
echo $string;
}
------------------------------------------------------------------------
[2004-08-10 03:12:12] jbrady at sbccd dot cc dot ca dot us
Description:
------------
I installed the latest version of php5 (built Aug 10 2004 02:15:17 ). I
used php.ini-recommended changing only:
display_errors = on
extension_dir = "c:\php\ext"
extension=php_gd2.dll
Tried on Windows XP and Windows 2003. When I use the imagegif()
function, it gives me a warning: "Warning: imagegif()
[function.imagegif]: Unable to open temporary file in
c:\Inetpub\wwwroot\tests\php\imagetest.php on line 6
"
It is not a permissions problem. The temporary file functions work, and
if I change it to imagejpeg, it outputs the picture, without any errors.
Reproduce code:
---------------
<?php
$strFileName = "http://static.php.net/www.php.net/images/php.gif";
$image = imageCreateFromGif($strFileName);
if(is_resource($image)) {
// NOTE:
// Required to get a picture on Netscape
// Comment out to get Error messages
header("Content-type: image/gif");
// END NOTE
imagegif($image);
imageDestroy($image);
exit;
}
?>
Expected result:
----------------
The php logo from the php website.
Actual result:
--------------
Warning: imagegif() [function.imagegif]: Unable to open temporary file
in c:\Inetpub\wwwroot\tests\php\imagetest.php on line 6
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29594&edit=1