How to make thumbnail of any image in java : code, Examples ?

 /* This code need to configure image magik tool for Image Processing */
 /* This code is completable for all windows and Linux operating system */

public int thumbImageMaker(String inputImage, String outputImage, int width, int height) {
        int returnCode = 0;
        Process process;
        try {

            String[] command = { "convert", "-thumbnail", width+"x"+height, 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

Database Connection using NODE JS example

Shallow Copy Deep Copy Java example