Carrierwave Error Msg: Failed to manipulate with MiniMagick, maybe it is not an image?

我怕爱的太早我们不能终老 提交于 2019-11-30 08:39:31
Ivan Linko

Was fighting with the same error today. The problem was not in mini_magick, the problem is in DELEGATES options in your imagemagick

If you run

convert -list configure

you should have something like this

Name          Value
-----------------------------------------------------------------
...
CONFIGURE     ./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'
CONFIGURE_PATH /usr/local/etc/ImageMagick/
COPYRIGHT     Copyright (C) 1999-2012 ImageMagick Studio LLC
...
DELEGATES     bzlib djvu fontconfig freetype gvc jpeg jng jp2 lcms lqr openexr png rsvg tiff x11 xml zlib
...
VERSION       6.7.5

But in my case key DELEGATES had only xml and zlib values

DELEGATES     xml zlib

The solution was to install imagemagick from source and add params to ./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

You can find installations instructions for MacOS here http://www.imagemagick.org/script/advanced-unix-installation.php

UPDATE

For some reasons, a system can be without jpeg convert libraries. To fix this you can install imagemagick using apt-get or ppa with all needed dependencies or try to install manualy

sudo apt-get install libjpeg62

See more info here https://askubuntu.com/questions/211627/how-to-add-support-for-the-jpeg-image-format

UPDATE 01/26/2013

To install libpng

Follow this link http://www.libpng.org/pub/png/libpng.html and find "Source Code" block. Copy a link for a latest version

1. wget http://download.sourceforge.net/libpng/libpng-1.5.13.tar.gz
2. tar xvfz libpng-1.5.13.tar.gz 
3. cd libpng-1.5.13/
4 ./configure
5. make
6. sudo make install
7. Rebuild imagemagick

Another way to get JPEG support

1. curl -O http://www.ijg.org/files/jpegsrc.v8c.tar.gz
2. tar zxvf jpegsrc.v8c.tar.gz
3. cd jpeg-8c/
4. ./configure
5. make
6. sudo make install
7. Rebuild imagemagick

Feb 2014

I just ran into this issue and was all excited to spend my day compiling ImageMagick from source, but figured I'd try a brew update && brew upgrade imagemagick first.

==> Upgrading 1 outdated package, with result:
imagemagick 6.8.7-7

It worked.

First make sure your machine has all the compilers and tools it needs.

sudo yum groupinstall "Development Tools"
sudo yum install rpmdevtool libtool-ltdl-devel

sudo yum install ImageMagick-devel
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!