JMagick Trouble Loading file
Posted: 2008-02-22T10:05:31-07:00
Hello,
I am new to ImageMagick. Today, I downloaded ImageMagick version 6.2.6 and JMagickVersion 6.2.6
We are using the Q16 or 16 bit version. I put the jar files in the JDK class path and as well installed the DLLs
We have put together some code in java, that tries to instantiate a single Image and tries to scale that image. The code is attached below.
We are facing the problem when instantiating the ImageInfo and ImageMagick objects. The ImageInfo call returns an object, but we checked some attributes like getDepth() and getMagick(). The former returned 0 and the latter returned an empty string. This makes us think that the ImageInfo object is not correctly initalized.
When we try to instantiate the ImageMagick object, the constructor call never returns. The debugger just hangs at the line but we don't get an exception.
The two lines of code are in bold below. Can anyone recommend a course of action. I noticed 1 or 2 people had the same problem on other forums but there was never a resolution posted.
Thanks in advance.
Rohit
----------------
package test;
import java.io.*;
import java.awt.Rectangle;
import magick.ImageInfo;
import magick.MagickImage;
import magick.MagickLoader;
public class Loop {
static {
System.loadLibrary("JMagick");
}
public static void main(String[] args) throws Exception
{
System.out.print("Started");
ImageInfo info = new ImageInfo("300 alarm clock.gif");
String depth = info.getMagick();
System.out.print("Depth is " + depth);
MagickImage image = null;
try{
image = new MagickImage(info);
}catch(Exception e) { System.out.println(e.getMessage());}
image.setFileName("copy_300 alarm clock.gif");
image.writeImage(info);
MagickImage thumb = image.scaleImage(100, 100);
System.out.print("Compleated");
Thread.sleep(1000);
// Force finalization and garbage collection.
System.runFinalization();
System.gc();
}
}
I am new to ImageMagick. Today, I downloaded ImageMagick version 6.2.6 and JMagickVersion 6.2.6
We are using the Q16 or 16 bit version. I put the jar files in the JDK class path and as well installed the DLLs
We have put together some code in java, that tries to instantiate a single Image and tries to scale that image. The code is attached below.
We are facing the problem when instantiating the ImageInfo and ImageMagick objects. The ImageInfo call returns an object, but we checked some attributes like getDepth() and getMagick(). The former returned 0 and the latter returned an empty string. This makes us think that the ImageInfo object is not correctly initalized.
When we try to instantiate the ImageMagick object, the constructor call never returns. The debugger just hangs at the line but we don't get an exception.
The two lines of code are in bold below. Can anyone recommend a course of action. I noticed 1 or 2 people had the same problem on other forums but there was never a resolution posted.
Thanks in advance.
Rohit
----------------
package test;
import java.io.*;
import java.awt.Rectangle;
import magick.ImageInfo;
import magick.MagickImage;
import magick.MagickLoader;
public class Loop {
static {
System.loadLibrary("JMagick");
}
public static void main(String[] args) throws Exception
{
System.out.print("Started");
ImageInfo info = new ImageInfo("300 alarm clock.gif");
String depth = info.getMagick();
System.out.print("Depth is " + depth);
MagickImage image = null;
try{
image = new MagickImage(info);
}catch(Exception e) { System.out.println(e.getMessage());}
image.setFileName("copy_300 alarm clock.gif");
image.writeImage(info);
MagickImage thumb = image.scaleImage(100, 100);
System.out.print("Compleated");
Thread.sleep(1000);
// Force finalization and garbage collection.
System.runFinalization();
System.gc();
}
}