9

In my Rails app, I just removed Rmagick and added Minimagick. Rmagick was too heavy. Things worked fine with Rmagick but in minimagick I get the following error :

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!'

The file url :

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

The code im trying to run :

MiniMagick::Image.read(file.file.file).first
THpubs
  • 7,804
  • 16
  • 68
  • 143
  • 1
    what do you get when you type this into the console: identify -list format | grep JPG – errata May 18 '15 at 17:59
  • 1
    I get this : ` JPG* JPEG rw- Joint Photographic Experts Group JFIF format (80` Im in Ubuntu 14.04 – THpubs May 18 '15 at 18:00
  • Looks like [liblqr](http://liblqr.wikidot.com/) wasn't linked correctly. Your application is expecting liquid rescale -- a feature not required by Minimagick. You'll need to rebuild ImageMagick with `--with-lqr=yes` – emcconville May 18 '15 at 19:16
  • @emcconville How can I it? I installed imagemagick from the package manager. But when using Rmagick it works! – THpubs May 19 '15 at 01:26

2 Answers2

6

Try to reinstall ImageMagick and add --with-jpeg=yes to the configuration.

Run convert -list configure, and see if you have jpeg under DELEGATES. If not, reinstall ImageMagick 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

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

Community
  • 1
  • 1
Shalev Shalit
  • 1,945
  • 4
  • 24
  • 34
0

I experienced the same thing on my Ubuntu server. However, I solved it by adding ghostscript and libgs-dev to my Dockerfile apt-get lines

FROM ruby:2.5.3

RUN apt-get update -qq && apt-get install -y \
  ghostscript libgs-dev imagemagick
dmrlps
  • 72
  • 1
  • 9