Split the bits that refer to the actual image from the rest

Started by andrea, December 22, 2023, 10:55:15 AM

Previous topic - Next topic

andrea

Hi, I was wondering if using the command exiftool mypicture.jpg or exiftool -ext jpg -all= --icc_profile:all -tagsfromfile @ -colorspacetags DIR shows/removes all metadata or only those that exiftool recognizes as such. Let me explain. I have a jpg image and I run exiftool mypicture.jpg. Does exiftool recognize the bits referring to the actual image? Does exiftool isolate them from the rest of the bits and then consider the rest as metadata and lists all the metadata in the terminal regardless of whether it is able to recognize what kind of metadata it is? For example, if I added my own metadata to a jpg image, would exiftool be able to detect it or would it only detect what it knows? Is it possible to divide the bits that refer to the actual image as it is designed in accordance with how the basic JPG format is structured from everything else?

Excuse me if it's a trivial question.

Phil Harvey

Quote from: andrea on December 22, 2023, 10:55:15 AMDoes exiftool recognize the bits referring to the actual image?

Yes.

QuoteDoes exiftool isolate them from the rest of the bits and then consider the rest as metadata

Yes.

Quote[...] and lists all the metadata in the terminal regardless of whether it is able to recognize what kind of metadata it is?

It won't list metadata written in formats it doesn't recognize.

QuoteIs it possible to divide the bits that refer to the actual image as it is designed in accordance with how the basic JPG format is structured from everything else?

Yes.  In JPEG images the metadata is well separated from the image data.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

andrea

is there a way with exiftool to eliminate all the bits that do not belong to the actual image (including even those that exiftool is not able to understand, like metadata written in formats it doesn't recognize) but preserve those that are fundamental to the photo?

I want to be 100% sure I have the image and fundamental metadata and nothing else.

thanks.

StarGeek

See FAQ #32.  As it says there, don't use it on RAW type files and probably not on TIFF files as well.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

andrea

Yes, I need it to delete all metadata from JPG photos and I was wondering if there was a way to delete all the metadata, also the metadata written in formats it doesn't recognize except the ICC Profile if it exists.

StarGeek

When it comes to images, then yes, the FAQ #32 command all data except for those that affect the color of the image.  Unknown tags still have to be part of a known groups, and the command removes entire groups.

Another option would be to do a destructive re-save of the image.  Load it into Paint and save it out again.

If you are looking at PDFs, then any change made by exiftool is reversible.  To make the changes permanent, you would have to re-linearize the file. See the PDF Tags page for details.

But PDFs are tricky.  Exiftool can't remove watermarks like you would see on purchased PDFs.  And there are many other sneaky ways of putting identifiable data in a PDF that exiftool can't touch.

For videos, things are more complicated.  There can be a lot of data in the file that can be embedded in the streams, such as GPS tracks. EXIF data is non-standard in a video and every company shoves it in a video in different ways. Exiftool can't remove these.  For that, you would have to remux the file with ffmpeg, which can be a lossless operation with a command like this.
ffmpeg -i input.mp4 -c copy -map 0 output.mp4

Or you could just recompress the video with a program like Handbrake, which doesn't copy any metadata to the new file.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype