All pastes #774309 Raw Edit

Someone

public java v1 · immutable
·published 2007-11-15 04:46 UTC
rendered paste body
    public static void makeThumbnails() throws IOException {        File in = new File("D:/public_html/poke/screenshots");        File out = new File(in.getParent(), "thumbs/");        out.mkdir();        for (File f : in.listFiles()) {            String name = f.getName();            if (name.endsWith(".png")) {                BufferedImage src = ImageIO.read(f),                              thumb = new BufferedImage(50, 50, BufferedImage.TYPE_INT_RGB);                Graphics g = thumb.getGraphics();                g.drawImage(src, 0, 0, 50, 50, null);                g.dispose();                ImageIO.write(thumb, "png", new File(out, name));            }        }    }