I'm trying to remove metadata from a .jpg file and replace it with nothing. Can anyone provide an example of how I might do this?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Metadata isn't read when you read in the image. So just read it in and write it back.
BufferedImage image = ImageIO.read(new File("image.jpg"));
ImageIO.write(image, "jpg", new File("image.jpg"));