How to convert image DPI in java code with image magick
public int convertDPI(String inputImage, String outputImage, String density) {
int returnCode = 0;
Process process;
try {
String[] command = { "convert", "-density", density, inputImage, outputImage };
process = Runtime.getRuntime().exec(command);
returnCode = process.waitFor();
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
return returnCode;
}
int returnCode = 0;
Process process;
try {
String[] command = { "convert", "-density", density, inputImage, outputImage };
process = Runtime.getRuntime().exec(command);
returnCode = process.waitFor();
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
return returnCode;
}
Comments
Post a Comment