在我的Rails应用程序中,我只是删除了Rmagick并添加了Minimagick。 Rmagick太重了。在Rmagick上一切正常,但是在minimagick中,出现以下错误:

MiniMagick::Invalid: `identify /tmp/mini_magick20150518-10411-1qz42x8` failed with error:
identify.im6: no decode delegate for this image format `/tmp/mini_magick20150518-10411-1qz42x8' @ error/constitute.c/ReadImage/544.
from /home/pubudu/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mini_magick-4.2.4/lib/mini_magick/image.rb:200:in `rescue in validate!'

文件网址:
[8] pry(main)> file.file.file
=> "/home/pubudu/Projects/istockseller/public/store/photos/thpubs/istockseller-13642162-wallhaven-61582.jpg"

我试图运行的代码:
MiniMagick::Image.read(file.file.file).first

最佳答案

尝试重新安装ImageMagick并将--with-jpeg=yes添加到配置中。

运行convert -list configure,查看DELEGATES下是否有 jpeg 。如果不是,请添加reinstall ImageMagick并将参数添加到./configure:

1. wget http://www.imagemagick.org/download/ImageMagick.tar.gz
2. tar xvfz ImageMagick.tar.gz
3. cd ImageMagick
4. ./configure --with-bzlib=yes --with-fontconfig=yes --with-freetype=yes --with-gslib=yes --with-gvc=yes --with-jpeg=yes --with-jp2=yes --with-png=yes --with-tiff=yes --disable-shared
5. make
6. sudo make install
7. sudo ldconfig /usr/local/lib
8. run again "convert -list configure" and look at changes

有关更多信息:Carrierwave Error Msg: Failed to manipulate with MiniMagick, maybe it is not an image?

关于ruby-on-rails - 用Minimagick替换Rmagick后,出现 'identify.im6: no decode delegate for this image format'错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30309633/

10-11 16:36