Infolinks In Text Ads

Jun 24, 2010

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

No comments:

Post a Comment

LinkWithin

Related Posts Plugin for WordPress, Blogger...