javaubuntuimagemagickjmagick

Jmagick error : magick.MagickException: No image to scale


I am trying to integrate jmagick over ImageMagick, so I have installed Image magick 6.4.0 and JMagick 6.4.0 Q16 on my Ubuntu 11.10 I tried the following piece of code on Eclipse to test jmagick integration :

try{
ImageInfo info = new ImageInfo("myPic.jpg");
MagickImage image = new MagickImage();
MagickImage bigger = image.scaleImage(1200, 900);
bigger.setFileName("bigger.jpg");
bigger.writeImage(info);
} catch (MagickException e){
e.printStackTrace();
}

When running a simple main class, I get the following exception :

magick.MagickException: No image to scale
at magick.MagickImage.scaleImage(Native Mehtod)
at comcom.myCompany.image.ImageTest.main(ImageTest.java:20)

Did anyone face/solve the same problem?


Solution

  • A solution might be to verify if image magick is configured to work with all needed image format.. To verify that, tap the following command and seach for the keyword DELEGATES for the file extensions ImageMagick is configured to use :

    convert -list configure
    

    If you don't have the required library installed, then you need to download it from the image magick delegates special page which you can find here : http://www.imagemagick.org/download/delegates/

    Once the delegate library downloaded, you need to unzip it and install it fowllowing these instrcutions :

    tar xzvf jpegsrc.v7.tar.gz
     cd jpegsrc/
     ./configure
     sudo make
     sudo make install
     make clean
    

    Next, you nedd to reconfigure and reinstall imagemagick from the source directory of image magick which you need to locate :

    ./configure
     sudo make
     sudo make install
    

    Now retry to see if image magick handles your image format