PHP ImageJPEG 方法,但适用于 Java
我正在寻找 Java 解决方案。我需要一个与 php IMAGEJPEG 方法行为完全相同的 Java 方法。
提前致谢。
I'm looking for a Java solution to this. I need a Java method that behave exactly the same as php IMAGEJPEG method does.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个关于在 Java 中保存图像的非常好的教程 http://download.oracle .com/javase/tutorial/2d/images/examples/。
您要查看的具体类是 ImageIO http ://download.oracle.com/javase/1.4.2/docs/api/javax/imageio/ImageIO.html
最后,要调整质量,请查看这篇文章 http://www.universalwebservices.net/web-programming-resources/java/adjust-jpeg-image-compression-quality-when- saving-images-in-java
Here is a really good tutorial on saving images in Java http://download.oracle.com/javase/tutorial/2d/images/examples/.
The specific class you want to look at is ImageIO http://download.oracle.com/javase/1.4.2/docs/api/javax/imageio/ImageIO.html
Finally, to adjust quality, take a look at this article http://www.universalwebservices.net/web-programming-resources/java/adjust-jpeg-image-compression-quality-when-saving-images-in-java