Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.imageio.ImageIO;
- import java.awt.image.BufferedImage;
- import java.io.File;
- import java.io.IOException;
- public class Xevuel {
- public static void main(String args[]) {
- if (args.length == 0) {
- System.err.println("ERR: No file specified");
- System.exit(-1);
- }
- if (!args[0].toLowerCase().endsWith(".bmp")) {
- System.err.println("ERR: Filename doesn't end with .bmp");
- System.exit(-1);
- }
- try {
- BufferedImage img = ImageIO.read(new File(args[0]));
- ImageIO.write(img, "png", new File(args[0].substring(0, args[0].length()-4) + ".png"));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement