Does deleting all metadata damage the file?

Started by Snowbound7138, November 27, 2022, 04:38:57 AM

Previous topic - Next topic

Snowbound7138

I'm trying to delete all metadata from pictures and videos that consist of (png, jpg, webp, mp4, mkv, gif)
and overwrite the original with -overwrite_original
will it damage the files and causing the video won't be able to play or unable to view the image or even changing in appearance?

wywh

This removes almost all metadada with no major side effects:

exiftool -overwrite_original -All= .
That does not touch JPEG APP14 Adobe segment which contains some color information that may severely affect the image appearance if deleted. This can be accomplished by adding -Adobe:All= to the command.

https://exiftool.org/forum/index.php/topic,6448.msg32114.html#msg32114

To remove everything but keep color data (ColorSpaceTags is a shortcut for the ICC_Profile and a few other color related tags. -All= removes everything but the -TagsFromFile option copies the color data back in):

exiftool -overwrite_original -All= -TagsFromFile @ -ColorSpaceTags .
In .mp4, .m4v and .mov movies the command above leaves QuickTime dates intact so you might want to reset them with:

exiftool -overwrite_original '-*date*=' .
Notice exiftool does not yet edit .mkv, for example.

Check the results with something like (add -n or -ee or -U for more options):

exiftool -a -G1 -s .

or:

exiftool -a -G1 -s -api RequestAll=2 .

https://exiftool.org/forum/index.php?topic=13867.0

- Matti

StarGeek

wywh's list pretty much covers everything.  There's only a couple things I would add.

FAQ #13 is worth reading.

The APP14 segment contains no identifiable data, so there is never a reason to remove it.

When there is an ICC_Profile in the image, using -All= will change the colors/look of an image if the the viewing program is aware and can use the profile. Exiftool will issue a ICC_Profile deleted. Image colors may be affected warning when this happens. Most modern software will read ICC_Profiles, so you will usually want to keep the data as wywh shows.  As with the APP14 segment, no identifiable data is held here and there's no real reason to remove it.

With regards to videos, exiftool has no ability to remove data that is embedded in the stream, such as GPS tracks.  It may not be able to edit/remove EXIF data from the video, as embedding EXIF data in a video file is non-standard and every camera manufacturer does it in different ways.

The best way to clean a video of metadata is to use ffmpeg.  This can be done without re-encoding the file by just copying the streams. You would use a command line this
ffmpeg -i input.mp4 -c copy -map 0 output.mp4
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).