FuelPHPのバージョン1.5を使って開発しています。
そこで、写真のアップロードについてお聞きします。
画像をアップロードすること自体に問題がないのですが、サイズ変更すると見たことのないエラーが表示されるのです。
lang
1public function add_image(){ 2 \Upload::process(array( 3 'path' => '../images/hoge/', 4 'normalize' => true, 5 'change_case' => 'lower', 6 'randomize' => true, 7 'ext_whitelist' => array('jpeg', 'jpg', 'gif', 'png'), 8 'max_size' => 1024 * 768, 9 10 )); 11 12 if (!\Upload::is_valid()) { 13 return $this->response(\Upload::get_errors()); 14 } else { 15 foreach (\Upload::get_files() as $ifile) { 16 17 //ここからエラーになります 18 $mod_image = Image::load($ifile['file'], false, $ifile['extension']); 19 $mod_image->crop_resize(800, 600); 20 $mod_image->save('test'); 21 22 } 23 } 24 25 //\Upload::save(); 26 27 return $this->response(\Upload::get_files()); 28}
以下のエラーになります
RuntimeException [ Error ]: The library does not support this filetype for /tmp/phpOnZReS.
COREPATH/classes/image/driver.php @ line
アップロードファイルのvar_dumpは以下のようになります。
lang
1array(10) { 2 ["name"]=> 3 string(27) "crunchbang-logo-minimal.png" 4 ["type"]=> 5 string(9) "image/png" 6 ["error"]=> 7 bool(false) 8 ["size"]=> 9 int(278) 10 ["field"]=> 11 string(10) "pictures:0" 12 ["file"]=> 13 string(14) "/tmp/phpDdTLwJ" 14 ["errors"]=> 15 array(0) { 16 } 17 ["extension"]=> 18 string(3) "png" 19 ["filename"]=> 20 string(23) "crunchbang-logo-minimal" 21 ["mimetype"]=> 22 string(9) "image/png" 23}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。