我正在尝试从.jpg文件中删除元数据,并将其替换为空。有没有人能举例说明我是如何做到这一点的?
发布于 2011-07-12 23:48:44
当您读取图像时,元数据不会被读取。所以只要读进去然后写回去就行了。
BufferedImage image = ImageIO.read(new File("image.jpg"));
ImageIO.write(image, "jpg", new File("image.jpg"));发布于 2019-09-18 12:32:17
Apache ExifRewriter:
读取Jpeg图像,删除所有EXIF元数据(通过删除APP1段),并将结果写入流。
FileInputStream is = new FileInputStream(new File("/path/to/photo.jpg"));
FileOutputStream os = new FileOutputStream(new File("/path/to/photo_without.jpg")))
new ExifRewriter().removeExifMetadata(is, os);https://stackoverflow.com/questions/6666999
复制相似问题