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

Use of req.query, req.params and req.body in NODE JS

How to capture finger prints in java