开发者

magick.MagickException: Unable to retrieve handle

I am trying to use JMagick in my app for last one week but sm still unsuccesfull. I installed JMagick 6.4.0 and ImageMagick 6.4.0 from source itself using default installation directories. I can see shared libraries in /usr/local/lib.

Now I try to run following program with option -Djava.library.path=/usr/local/lib.

public class JMagickTest {
    public static void main(String[] args) {
        try {
            System.setProperty("jmagick.systemclassloader", "fals开发者_如何学Goe");
            System.out.println(System.getProperty("java.library.path"));
            ImageInfo info = new ImageInfo("/home/blue_bg.jpg");
            MagickImage image = new MagickImage(info);
            System.out.println(image.getBackgroundColor());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

It gives following error.

/usr/local/lib
magick.MagickException: Unable to retrieve handle
        at magick.MagickImage.getBackgroundColor(Native Method)
        at JMagickTest.main(JMagickTest.java:19)

Could any one please help me here. Also Could some please suggest proper way to uninstall ImageMagick from system.

Thanks in advance

Jitendra


Finally I found out the error.

I think, Unable to retrieve handle is a very generic error which may occur due to variety of reasons. One could be multiple installations of Imagemagick.

Error in my case was, delegate library for JPEG format was not installed. so I followed instructions on http://blog.ericlamb.net/2008/11/fix-for-convert-no-decode-delegate-for-this-image-format/ to first install this library then re install imagemagick. It solved the problem.


Google seems to think that this error relates to you having multiple copies of ImageMagick on your system and it is getting confused when it tries to retrieve a handler. I would suspect that JMagick packages ImageMagick into it and that would possibly be where the duplication is coming from.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜