I am using PaperClip and ImageMagick to upload and generate images in my Rails 2.2.2 application.
我正在使用PaperClip和ImageMagick在我的Rails 2.2.2应用程序中上传和生成图像。
It was working fine. But now when uploading image, the different sizes of image which gets generated at the time of upload is not working. The image is getting uploaded.
它工作正常。但是现在上传图像时,上传时生成的不同大小的图像不起作用。图像正在上传。
I am getting the following error in log.
我在日志中收到以下错误。
INFO production : [paperclip] /usr/local/bin/identify -format "%w" /www/hosts/{path}
INFO production : <Paperclip::PaperclipCommandLineError> Error while running identify
/www/hosts/{path}/vendor/plugins/paperclip/lib/paperclip.rb:101:in `run'
I can't understand what is happening here. I checked the path of identify using which identify
which returned user/local/bin/identify
.
我无法理解这里发生了什么。我检查了识别路径,使用哪个识别哪个返回用户/本地/ bin /识别。
The Paperclip in config is as
配置中的Paperclip为
Paperclip.options[:image_magick_path] = "/usr/local/bin"
Paperclip.options[:command_path] = '/usr/local/bin'
Any idea what is happening here??
知道这里发生了什么?
I tried to add a Paperclip custom validation to the model. I think the image upload went wrong after this validation. I have removed it. But still not working.
我尝试将Paperclip自定义验证添加到模型中。我觉得验证后图片上传出错了。我删除了它。但仍然没有工作。
This is the line of code which stops it all in square_up function.
这是在square_up函数中停止它的所有代码行。
Paperclip.run('identify', args).strip
The Paperclip is not able to process image.img format.
Paperclip无法处理image.img格式。
The symlink master.img is not generated properly. A symlink is created as master.png and it points to master.img. The symlink should be master.img which points to the real image uploaded.
符号链接master.img未正确生成。符号链接创建为master.png,它指向master.img。符号链接应该是master.img,它指向上传的真实图像。
2 个解决方案
#1
0
It seems like issue with your imagemagick installation. Try find if you have properly installed imagemagick or not, Try run convert
on console.
这似乎与您的imagemagick安装有关。尝试查找是否已正确安装imagemagick,尝试在控制台上运行convert。
$ convert
Version: ImageMagick 6.6.9-7 2014-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
You should get result something like above. If you get above result try upgrade imagemagick version.
你应该得到类似上面的结果。如果您获得以上结果,请尝试升级imagemagick版本。
libtool also cause such errors, SO try install libtool
also.
libtool也会导致这样的错误,所以也尝试安装libtool。
Hope this works.
希望这有效。
#2
0
I uninstalled and reinstalled ImageMagick from source. The decode delegate libraries for jpeg and png were missing. Installed them individually by yum install libpng libpng-devel
and yum install libjpg libjpg-devel
.
我从源代码中卸载并重新安装了ImageMagick。缺少jpeg和png的解码委托库。通过yum install libpng libpng-devel和yum install libjpg libjpg-devel单独安装它们。
After that reinstalled ImageMagick and everything works fine.
之后重新安装了ImageMagick,一切正常。
#1
0
It seems like issue with your imagemagick installation. Try find if you have properly installed imagemagick or not, Try run convert
on console.
这似乎与您的imagemagick安装有关。尝试查找是否已正确安装imagemagick,尝试在控制台上运行convert。
$ convert
Version: ImageMagick 6.6.9-7 2014-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
You should get result something like above. If you get above result try upgrade imagemagick version.
你应该得到类似上面的结果。如果您获得以上结果,请尝试升级imagemagick版本。
libtool also cause such errors, SO try install libtool
also.
libtool也会导致这样的错误,所以也尝试安装libtool。
Hope this works.
希望这有效。
#2
0
I uninstalled and reinstalled ImageMagick from source. The decode delegate libraries for jpeg and png were missing. Installed them individually by yum install libpng libpng-devel
and yum install libjpg libjpg-devel
.
我从源代码中卸载并重新安装了ImageMagick。缺少jpeg和png的解码委托库。通过yum install libpng libpng-devel和yum install libjpg libjpg-devel单独安装它们。
After that reinstalled ImageMagick and everything works fine.
之后重新安装了ImageMagick,一切正常。