开发者

ImageMagick leaving behind temp files - is this by design or should they be automatically deleted?

I've installed ImageMagick on OS X using macports (I don't think these makes any difference but just in case)

I use the following:

$im = new开发者_开发技巧 imagick($src . '[0]'); 
$im->setImageFormat('png'); 

header("Content-Type: image/png" );

echo $im;

and I get a nice conversion of a pdf to a png. Every time I do that however, I end up with a file like:

magick-23Iwt3tG

in /private/var/tmp. They do not seem to delete automatically.

Do I need to delete these manually or is there an option I can set to have them automatically deleted? (I don't want to end up with tons of these files hanging around)


The contents of /private/var/temp can be safely deleted but are not included in the /etc/rc.cleanup and /etc/weekly scripts which remove temporary files.

You can either do it manually or there is a script here which should do it for you.


I think you should use Imagick::clear() or Imagick::destroy() at the end of your script, it takes care of cleaning up everything.

I know it is a bit of a late response to your question, sorry about that :).


You have to write your own script to delete them. For example cron, or sth. Check this link http://www.webmasterworld.com/forum88/4135.htm

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜