The problem with excluding tags from copying

Started by Fedor72, January 19, 2021, 03:48:20 AM

Previous topic - Next topic

Fedor72

Greetings friends.

The crux of the problem: I copy all metadata from jpg to jpg, but the thumbnail is also copied.
But the thumbnail must remain the same, not copied.

I found an IME tag that seems to be responsible for thumbnail. Found, like, how to exclude this tag(--TAG, yes?). But for some reason I can't get what I need.

I don't know English well, so a translator helps me. Therefore, perhaps I do not understand something.

Final question: my command "exiftool -TagsFromFile src .jpg -IPTC -EXIF -XMP dst .jpg", what and where to paste correctly so that the thumbnail is not copied.

Thank you all in advance for your help.

Phil Harvey

If you copy the EXIF with -exif, it will be copied as a block, and this will include the thumbnail.

Instead, you should use -exif:all --thumbnailimage to copy all EXIF tags except the thumbnail.

- 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 ($).

Fedor72

Again, thank you for your help. I'm starting to understand a little how it works.

Fedor72

There was a problem.

-EXIF and -exif: all copy differently, the result is different. And I need a complete copy of the metadata. You helped me somehow https://exiftool.org/forum/index.php?topic=11899
I'm using the query "exiftool -TagsFromFile src.jpg -IPTC -EXIF -XMP -Thumbnail dst.jpg". Previously, this team did not copy the preview, but recently began to notice it.

I still need a complete copy of the picture (in terms of metadata), but without copying the preview. Is it possible?

Phil Harvey

Are you talking about the preview (PreviewImage) or the thumbnail (ThumbnailImage)?

The PreviewImage is normally not copied in the EXIF block because it usually resides outside the EXIF.

To do a full copy of EXIF while preserving the ThumbnailImage would take 2 commands:

1.  exiftool dst.jpg -tagsfromfile src.jpg -exif

2.  exiftool dst.jpg -tagsfromfile dst.jpg_original -thumbnailimage

- 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 ($).

Fedor72

Quote from: Phil Harvey on January 19, 2021, 10:39:39 AM
Are you talking about the preview (PreviewImage) or the thumbnail (ThumbnailImage)?

The PreviewImage is normally not copied in the EXIF block because it usually resides outside the EXIF.

To do a full copy of EXIF while preserving the ThumbnailImage would take 2 commands:

1.  exiftool dst.jpg -tagsfromfile src.jpg -exif

2.  exiftool dst.jpg -tagsfromfile dst.jpg_original -thumbnailimage

- Phil
What am I doing wrong?:(

Phil Harvey

Apparently there was no ThumbnailImage in the original JPG.  This command handles that case:

2. exiftool dst.jpg -ifd1:all= -tagsfromfile dst.jpg_original -thumbnailimage

This command removes IFD1 (the thumbnail IFD) from the JPG, then copies back the ThumbnailImage (thus re-creating IFD1) if it existed in the original.

- 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 ($).

Fedor72

Quote from: Phil Harvey on January 20, 2021, 07:46:26 AM
Apparently there was no ThumbnailImage in the original JPG.  This command handles that case:

2. exiftool dst.jpg -ifd1:all= -tagsfromfile dst.jpg_original -thumbnailimage

This command removes IFD1 (the thumbnail IFD) from the JPG, then copies back the ThumbnailImage (thus re-creating IFD1) if it existed in the original.

- Phil

It doesn't want to give in  :)

Phil Harvey

There shouldn't be a space after -ifd1:

or after all
...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 ($).

Fedor72

Quote from: Phil Harvey on January 20, 2021, 08:43:41 AM
There shouldn't be a space after -ifd1:

or after all

Yes, it worked. Unfortunately, the metadata is still different after the last command.
Like after doing "-exif: all --thumbnailimage", which you previously advised.
They are identical only after the first copy command "-exif".

Apparently, what I need is impossible.
Thanks Phil for your help and your time.

Oddly enough, the thumbnail was not copied before. I just checked it on my first jobs. Is it possible that something has been updated in the program during this time (1-2 months)?

Phil Harvey

Quote from: Fedor72 on January 21, 2021, 02:16:38 AM
Unfortunately, the metadata is still different after the last command.
[...]

Apparently, what I need is impossible.

Yes.  It is not possible for me to tell you how to fix this if you don't tell me what is different.

QuoteOddly enough, the thumbnail was not copied before. I just checked it on my first jobs. Is it possible that something has been updated in the program during this time (1-2 months)?

No.

- 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 ($).