Proper way to store temporary image files for PHP
<p>I have an image resource that is manipulated with <code>imagecopyresampled</code>.  I need to pass that image to a set of methods that expect a string input, not a resource.  But I don't need to store the file locally.</p>

<p>Is this the proper way:</p>

<ol>
<li>Store the image with <code>imagepng</code> and <code>imagejpeg</code> </li>
<li>Pass string (filename) to the methods</li>
<li>Destroy the stored file with <code>@unlink</code></li>
</ol>

<p>Is that right?  Seems sloppy.</p>

<p><em>Note: the image is not coming from a file upload and hence can't be accessed with <code>$_FILES["Filedata"]["tmp_name"]</code></em></p>
