My requirement is to convert multiple jpeg files to a multi-page Tiff file. Initially, I've gone through this post and I was able to create tiff files in java using jai_imageio libraries but unfortunately these libraries are not open source. Later, I've heard about ImageMagick which could exactly give me what I want. I installed ImageMagick in my machine and I wrote a small utility program which takes multiple jpegs as input and gives a TIFF file as output.
The code:
try {
Process p = Runtime
.getRuntime()
.exec("C:/Program Files/ImageMagick-6.8.8-Q16/convert E:/1.jpg E:/2.jpg E:/3.jpg -compress JPEG "
+"E:/mul.tiff");
p.waitFor();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
The utility works very fine but the problem with the above program is, I cannot debug and the above code wouldn't throw any error even if I specify wrong path for input files.
I know about Jmagick which provides a Java Interface for ImageMagick. It'd be helpful for me if anyone provides me a Jmagick sample program in java which can create multi-page tiff by multiple jpegs as input.
Thanks.