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;
    }

Comments

Recent Post

Recent Posts Widget

Popular posts from this blog

Capture image from webcam java code, examples

Shallow Copy Deep Copy Java example

Database Connection using NODE JS example