开发者

JPEG to JFIF conversion

I need to convert jpeg image to jfif format this is because i need to send MMS开发者_如何学Python data. Can any one tell me how do convert it using java.


Have you tried ImageIO? I really dont know if it will work and I can't test it now (because I'm not in my home) but you can get ImageIO image formats using:

String[] formatNames = ImageIO.getReaderFormatNames();

As I said, I cant test this code, but you can try:

    try {
        File input = new File("srcImage.jpeg");
        BufferedImage image = ImageIO.read(input);

        File output = new File("dstImage.jfif");
        ImageIO.write(image, "jfif", output);

        System.out.println("Your image has been converted successfully");
    } catch(Excpetion e){
        System.out.println("Error:"+e.getMessage());
    }

To be honest, I dont think this will work. Maybe you can try a 3rd party plugin (if exists).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜