imagecache_create_path() と getimagesize() を使用して、imagecache で生成された画像のパスとそのサイズを取得しています。ただし、そのページに初めてアクセスした場合、画像はまだ存在せず、imagecache_create_path も画像を生成しません。
コードは次のとおりです。
// 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 から (プリセットを使用して) 画像を生成できますか?
前もって感謝します