Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jmagick help needed  RSS feed

 
Sam Venkata
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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(magickImage.toString());


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

}
and the exception I get is this...

[B@5740bb --- 152113 ------ http://********/proj/images/Sample.gif
magick.MagickImage@4a65e0
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.

Thanks,
Samanth.
 
Vinay Mysore
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mykola Senyk
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
System.setProperty("jmagick.systemclassloader","false");
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!