Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove EXIF content from a image file of TIFF,PNG using a Java API

Tags:

java

I'm using apache-commons-sanselan.jar API to remove EXIF content from only JPEG file.

How to remove this content from other file extensions?

like image 319
Puneeth Reddy V Avatar asked Jan 08 '23 02:01

Puneeth Reddy V


1 Answers

BufferedImage image = ImageIO.read(new File("image.jpg"));  
ImageIO.write(image, "jpg", new File("image.jpg"));  

Metadata isn't read when you read an image. Just write it back. Replace jpg with the extension you want.

Sources:
How to remove Exif,IPTC,XMP data of a png image in Java
How can I remove metadata from a JPEG image in Java?

like image 134
An SO User Avatar answered Jan 26 '23 12:01

An SO User