note 13753 added to function.imagecreatefromgif.php

From: Date: Sun, 01 Jul 2001 22:42:21 +0000
Subject: note 13753 added to function.imagecreatefromgif.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-14843@lists.php.net to get a copy of this message
To the above example for the function <pre> function myImageCreateFromGif($file_or_url) { $dummy_file = "/tmp/dummy.gif"; and later # write the contents to a dummy file $output = fopen("$dummy_file", "wb"); It would be better, to create the $output with tmpfile(); i.e.: $output = tmpfile(); Then you can also leave the unlink out, because you can simply close the file: i.e. fwrite($output, $image_data); # create the gif from the dummy file $image = ImageCreateFromGif($dummy_file); # get rid of the dummy file fclose($output); Please, remember that the file is deleted, when it is closed ... http://www.php.net/manual/en/function.imagecreatefromgif.php

« previous php.notes (#14843) next »