Magick++ NoDecodeDelegateForThisImageFormat

1.2k views Asked by At

I've googled my problem and found many pages, but none of them have exactly the same flavour and I can't get my problem to go away.

I have a program which uses Magick++ and works fine on my PC, but it fails on another computer where I'm trying to run the code. A minimal example is this:

#include <iostream>
#include <Magick++.h>

int main(){
    Magick::Image im;
    im.read( "/fullpathtoimage.jpg" );
    std::cout<< im.columns() <<"\n";
    return 0;
}

(where of course "/fullpathtoimage.jpg" is a valid image).

This raises an exception:

terminate called after throwing an instance of 'Magick::ErrorMissingDelegate'
  what():  ImageMagick: NoDecodeDelegateForThisImageFormat `/fullpathtoimage.jpg' @ constitute.c/ReadImage/503
Aborted

Other reports of this problem basically say that they don't have delegates for jpeg, and should install libjpeg etc, but they were getting the same errors when running 'convert'. However, when I do

./convert /fullpathtoimage.jpg temp.png

It runs perfectly. Doing

./identify -list configure

lists, amongst others

DELEGATES      bzlib mpeg fontconfig freetype jng jpeg pango png ps x xml zlib
LIBS           -lfreetype -ljpeg -lpng12 -lfontconfig -lXext -lXt -lSM -lICE -lX11 -lbz2 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lxml2 -lz -lm

and

./identify -list format | grep JPEG

gives

  JNG* rw-   JPEG Network Graphics
 JPEG* rw-   Joint Photographic Experts Group JFIF format (62)
PJPEG* rw-   Joint Photographic Experts Group JFIF format (62)

So, all seems fine, all binaries work, just my code doesn't.

The version I installed is ImageMagick-6.8.7-8, I built it from sources as I don't have root access at the machine, and I installed it to a location within my home (using ./configure --prefix=/home/... ). I checked if maybe there's an issue with linking my program against wrong ImageMagick (as there is an older system one too), but ldd reveals all is fine i.e. the program is linked against the one I installed, as I wanted, and running ldd on convert shows it is linked against exactly the same libraries.

0

There are 0 answers