1
我使用SimpleImage.php類:http://www.white-hat-web-design.co.uk/blog/resizing-images-with-php/來調整,壓縮和保存圖像。如何將圖片從url添加到temp?
通常用它與輸入的圖像:
$tmp_dir = $_FILES['file']['tmp_name'];
$file_name = 'something.jpg';
include('SimpleImage.php');
$image = new SimpleImage();
$image->load($tmp_dir);
$image->resizeToWidth($width);
$image->save('imgd/l'.$file_name);
但我怎麼能與圖像處理的URL僅僅?(從另一個網站)
$img = file_get_contents($url);
上面$img
變量保持的實際圖像。 那麼如何將它保存到臨時使用它呢? 如果這是正確的方法。
如果可能不需要更改SimpleImage.php類。
感謝,現在我想通了,它的工作原理還剛剛與網址,我有另一個錯誤。 – slownage