Page 1 of 1

ErrorMissingDelegate while convert works

Posted: 2013-12-07T18:16:37-07:00
by Relja
Hi,

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:

Code: Select all

#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:

Code: Select all

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

Code: Select all

./convert /fullpathtoimage.jpg temp.png
it runs perfectly. Doing

Code: Select all

./identify -list configure
lists, amongst others

Code: Select all

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

Code: Select all

./identify -list format | grep JPEG
gives

Code: Select all

  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 work on this one machine (works on my PC).

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. Also, ldd shows that my program is indeed linked against libjpeg.so.62 .