
hi,
I am writing the code for resizing the images into which the image will be get from one location and save the resized images to the another location. for example : get an image to resize from c:\myDirectory\images and save the resized image to c:\myDirectory\newImages. When I compile my code it gets the image from c:\myDirectory\images and resized it successfully but the resized images are not saved into the c:\myDirectory\newImages rather these are saved into the c:\myDirectory. Code is given below :
try{
String path = "C:\\myDirectory\\images";
File file = new File(path+"\\test.jpg")
ImageInfo ii = new ImageInfo(file);
MagickImage mi = new MagickImage(ii);
String destPath = "C:\\myDirectory\\neImages";
File destFile = new File(destPath);
mi.setFileName(destPath+ "."+fileFormat);
mi.writeImage(ii);
}catch(Exception ex){
System.out.println(ex.getMessage()+"Directory not selected");
}
The code doesn't contain the code for image resizing.

hi,
I have also faced the same problem, use this code it may help you to save the resized image to a specific location
try{
String path = "C:\\myDirectory\\images";
File file = new File(path+"\\test.jpg")
ImageInfo ii = new ImageInfo(file);
MagickImage mi = new MagickImage(ii);
String destPath = "C:\\myDirectory\\neImages\\tested";
File destFile = new File(destPath);
mi.setFileName(destPath+ "."+"jpg");
mi.writeImage(ii);
}catch(Exception ex){
System.out.println(ex.getMessage()+"Directory not selected");
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.