Forums Register Login
jmagick help needed
I was trying to get images from a url and I have no problems in getting the images. I can do image manipulations on the ones I get but I can do them only on regualr jpeg and gif image types.
When I have an animated gif image I have exceptions. I really appreciate help with this.

My code looks some thing like this.
byte[] blob=Functions.getImage(sImageURL);
if (blob!=null)
System.out.println(blob+" --- "+blob.length+" ------ "+sImageURL);

magickImage=new MagickImage(new ImageInfo(), blob);

System.out.println("format : "+magickImage.getImageFormat());

and the exception I get is this...

[B@5740bb --- 152113 ------ http://********/proj/images/Sample.gif
magick.MagickException: No image to get image format
at magick.MagickImage.getMagick(Native Method)
at magick.MagickImage.getImageFormat(MagickImage.java:1005)
at com.lsn.image.ImageResize.getImageFromUrl(ImageResize.java:51)
at com.lsn.image.ImageResize.main(ImageResize.java:231)
I have been trying out various other options but I was not able to find what the problem is?
Can some body please help me with this.

I am getting the following exception while trying to resize the image using jmagick. The application is running under jboss.

Caused by: java.lang.RuntimeException: Can't load MagickLoader (class not found)
at magick.Magick.(Magick.java:25)

It works fine when i run the resize code in a small java class outside the jboss. I have included the jmagick.jar file under the application lib dir as well as the jre/lib/ext. I have installed the imagemagick and have put the jmagick.dll file in the imagemagick installation directory. Please let me know how to solve this, i have wasted 1 full day on this.
thanks in advance.
Vinay, welcome to JavaRanch.

I would be surprised if JBoss checked where ImageMagick is installed, and tried to load the DLL from there. For the JVM to find native libraries, they likely need to be in the PATH.

Please note that in general you should start a new thread instead of hijacking an existing one if the question has little or nothing to do with the original one.
I am get the same error with JMagick and Tomcat on Debian x64.
To fix this I use such steps:
- add to Tomcat java.library.path folder with shared library (/usr/local/lib on linux)
- disable system class loader for JMagikc:
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
Programmatically Create PDF Using Free Spire.PDF with Java

This thread has been viewed 6714 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jan 23, 2019 17:46:27.