在上次修改rotateImage更新后的PHP Imagick

时间:2013-08-14 11:15:38

标签: php imagick

我有一个用户可以上传图片的网站。有时这些图像需要旋转。

使用Imagicks rotateImage功能没有问题,但图片可能已被网站上的其他用户缓存。我可以更新上次修改标题的图像文件吗?

我的旋转脚本:

    $imagick = new Imagick(); 
    $imagick->readImage("path-to-image"); 
    $imagick->rotateImage(new ImagickPixel(), 90); 
    $imagick->writeImage(path-to-image);
    print $imagick->getImage();

1 个答案:

答案 0 :(得分:0)

旋转后,使用过去的过期日期为图像投放

header("Cache-Control: no-cache, must-revalidate"); 
header("Expires: Sat, 26 Jul 2007 05:00:00 GMT");