im4java image converter issue
Posted: 2011-08-09T02:06:33-07:00
Hi All,
I am using im4java jdk 1.5 jar to convert eps image to jpg image format
but i am getting following error
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1768)
at java.lang.String.substring(String.java:1735)
at org.im4java.core.ImageCommand.resolveImages(ImageCommand.java:280)
at org.im4java.core.ImageCommand.prepareArguments(ImageCommand.java:189)
at org.im4java.core.ImageCommand.run(ImageCommand.java:208)
at ImageConv.conv(ImageConv.java:52)
at ImageConv.main(ImageConv.java:72)
my code is following
import org.im4java.core.ConvertCmd;
import org.im4java.core.IMOperation;
public static void main(String[] args) {
File fin = new File("imgeps.eps");
File fout = new File("Eur_img112.jpg");
conv(fin,fout);
}
public static void conv(File fin,File fout)
{
String myPath="D:\\Program Files\\ImageMagick-6.7.1-2";
IMOperation op = new IMOperation();
op.addImage("D:\\Test_28_march\\imageprj\\imgeps.eps");
op.addImage("D:\\Test_28_march\\imageprj\\Eur_img.jpg");
ConvertCmd convert = new ConvertCmd();
convert.setSearchPath(myPath);
convert.run(op, new Object[]{fin.getAbsolutePath(), fout.getAbsolutePath()});
}
could you please help me to sort ouot this issue..
Thanks in advance
Sandeep
I am using im4java jdk 1.5 jar to convert eps image to jpg image format
but i am getting following error
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1768)
at java.lang.String.substring(String.java:1735)
at org.im4java.core.ImageCommand.resolveImages(ImageCommand.java:280)
at org.im4java.core.ImageCommand.prepareArguments(ImageCommand.java:189)
at org.im4java.core.ImageCommand.run(ImageCommand.java:208)
at ImageConv.conv(ImageConv.java:52)
at ImageConv.main(ImageConv.java:72)
my code is following
import org.im4java.core.ConvertCmd;
import org.im4java.core.IMOperation;
public static void main(String[] args) {
File fin = new File("imgeps.eps");
File fout = new File("Eur_img112.jpg");
conv(fin,fout);
}
public static void conv(File fin,File fout)
{
String myPath="D:\\Program Files\\ImageMagick-6.7.1-2";
IMOperation op = new IMOperation();
op.addImage("D:\\Test_28_march\\imageprj\\imgeps.eps");
op.addImage("D:\\Test_28_march\\imageprj\\Eur_img.jpg");
ConvertCmd convert = new ConvertCmd();
convert.setSearchPath(myPath);
convert.run(op, new Object[]{fin.getAbsolutePath(), fout.getAbsolutePath()});
}
could you please help me to sort ouot this issue..
Thanks in advance
Sandeep