JPEG到JFIF的转换(JPEG to JFIF conversion)

编程入门 行业动态 更新时间:2024-10-24 14:24:04
JPEG到JFIF的转换(JPEG to JFIF conversion)

我需要将jpeg图像转换为jfif格式,这是因为我需要发送彩信数据。 任何人都可以告诉我如何使用java转换它。

I need to convert jpeg image to jfif format this is because i need to send MMS data. Can any one tell me how do convert it using java.

最满意答案

你试过ImageIO吗? 我真的不知道它是否会起作用,我现在无法测试它(因为我不在家里)但你可以使用以下方法获得ImageIO图像格式:

String[] formatNames = ImageIO.getReaderFormatNames();

正如我所说的,我无法测试此代码,但您可以尝试:

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

说实话,我不认为这会奏效。 也许你可以尝试第三方插件(如果存在)。

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).

更多推荐

本文发布于:2023-08-03 14:09:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1390783.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:JPEG   JFIF   conversion

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!