3
我使用imagecache_create_path()和getimagesize()來獲取imagecache生成的圖像及其尺寸的路徑。但是,如果這是我們第一次訪問該圖像不存在的頁面,並且imagecache_create_path也不會生成該圖像。在使用imagecache_create_path&getimagesize之前使用Drupal imagecache生成圖像
下面的代碼:
// we get the image path from a preset (always return the path even if the file doesn't exist)
$small_image_path = imagecache_create_path('gallery_image_small', $image["filepath"]);
// I get the image dimensions (only if the file exists already)
$data_small = list($width, $height, $type, $image_attributes) = @getimagesize($small_image_path);
是否有任何API方法來獲取路徑並生成文件?換句話說,我可以在PHP中生成圖像(使用預設),而無需在瀏覽器中顯示它嗎?
預先感謝您
的偉大工程。謝謝:) – ozke 2010-06-03 12:48:48
在Drupal 6.25上,如果你在頁面加載時'打印'imagecache'',或者在加載的響應內容中已經有imagecache'',則圖像將由系統。 – atwixtor 2012-05-04 18:37:52