cakephp 和 imagick - 原始文件无法上传
当我上传 JPEG 时,一切正常。然而,当上传 RAW 时,它确实有效。我将 php.ini 上传限制设置为 25M。我可以上传 7MB JPEG 文件,但不能上传 7MB RAW 文件。以下是我收到的错误:
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: PHP Fatal error: Uncaught exception 'ImagickException' with message 'Can not process empty wand' in /home/photobound/public_html/plugins/photo_bank/models/photo_bank_image.php:264, referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: Stack trace:, referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #0 /home/photobound/public_html/plugins/photo_bank/models/photo_bank_image.php(264): Imagick->getimagewidth(), referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #1 /home/photobound/public_html/plugins/photo_bank/models/photo_bank_image.php(124): PhotoBankImage->computeImageFieldsForSave(), referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #2 /usr/share/php/cake/cakephp/cake/libs/model/model.php(1282): PhotoBankImage->beforeSave(Array), referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #3 /home/photobound/public_html/plugins/photo_bank/controllers/photo_bank_images_controller.php(131): Model->save(Array), referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #4 [internal function]: PhotoBankImagesController->upload('-1'), referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #5 /usr/share/php/cake/cakephp/cake/dispatcher.php(204): call_user_func_array(Array, Array), referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #6 /usr/share/php/cake/cakephp/cake/dispatcher.php(171): Dispatcher->_invoke(Object(PhotoBankImagesController), Array), referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #7 /home/photobound/public_html/webroot/index.php(84): Dispatcher->dispatch(), referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #8 {main}, referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: thrown in /home/photobound/public_html/plugins/photo_bank/models/photo_bank_image.php on line 264, referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
这是第 264 行的代码:
$this->data['PhotoBankImage']['width'] = $this->image->getImageWidth();
这是我认为相关的 php.ini 设置:
post_max_size = 25M
post_max_size = 25M
memory_limit = 512M
max_execution_time = 120
max_input_time = 120
我将不胜感激任何帮助,如果您需要我提供任何其他信息以了解问题。
When I upload a JPEG everything works just fine. However, when upload a RAW it does work. I have the php.ini upload limits set to 25M. I was able to upload a 7MB JPEG file but not a 7MB RAW file. Below is the error I am recieving:
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: PHP Fatal error: Uncaught exception 'ImagickException' with message 'Can not process empty wand' in /home/photobound/public_html/plugins/photo_bank/models/photo_bank_image.php:264, referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: Stack trace:, referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #0 /home/photobound/public_html/plugins/photo_bank/models/photo_bank_image.php(264): Imagick->getimagewidth(), referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #1 /home/photobound/public_html/plugins/photo_bank/models/photo_bank_image.php(124): PhotoBankImage->computeImageFieldsForSave(), referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #2 /usr/share/php/cake/cakephp/cake/libs/model/model.php(1282): PhotoBankImage->beforeSave(Array), referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #3 /home/photobound/public_html/plugins/photo_bank/controllers/photo_bank_images_controller.php(131): Model->save(Array), referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #4 [internal function]: PhotoBankImagesController->upload('-1'), referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #5 /usr/share/php/cake/cakephp/cake/dispatcher.php(204): call_user_func_array(Array, Array), referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #6 /usr/share/php/cake/cakephp/cake/dispatcher.php(171): Dispatcher->_invoke(Object(PhotoBankImagesController), Array), referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #7 /home/photobound/public_html/webroot/index.php(84): Dispatcher->dispatch(), referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: #8 {main}, referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
[Wed Aug 17 17:23:55 2011] [warn] [client 192.168.1.6] mod_fcgid: stderr: thrown in /home/photobound/public_html/plugins/photo_bank/models/photo_bank_image.php on line 264, referer: http://photobound.local/photo_bank/js/plupload/plupload.flash.swf
Here is the code on line 264:
$this->data['PhotoBankImage']['width'] = $this->image->getImageWidth();
Here are my php.ini settings that I thought were relevent:
post_max_size = 25M
post_max_size = 25M
memory_limit = 512M
max_execution_time = 120
max_input_time = 120
I'd appreciate any help, let me know if you need anything else from me in order understand the problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
RAW 文件不是标准图像。标准图形库将无法与它们一起使用。格式因相机品牌/型号等而异。
RAW files are not standard images. Standard graphics libraries are not going to be able to work with them. The format varies depending on camera make/model, etc.