Deleting EXIF tags creates IPTC

Started by herb, August 06, 2017, 08:49:01 AM

Previous topic - Next topic

herb

Hello Phil,

I have the following test scenario in order to test Exiftool argument-files exif2xmp.args and also xmp2exif.args.
I work on a Windows 7 system with Exiftool 10.60.

All argument files (together with additional options) are sent to Exiftool via pipe from my C++ application using -stay_open true:
(0) I start with an *.jpg image out-of-camera from an Olympus E-PL6
(1) I copy the EXIF-tags to XMP-tags using the argument-file exif2xmp.args
(2) In order to see what the argument file xmp2exif.args really does, I have created an argument-file xmp2exifdel.args
    that deletes many many EXIF-tags.
(3) After the EXIF-tags are deleted (in step 2) I call Exiftool with argument-file xmp2exif.args.

Now to my surprise the image file also contains an IPTC section. This is totally unclear to me.
I know it sounds crazy, but I repeated the test more than once.
Doing lots of analysis e.g. with -v3 option I have seen that IPTC tags are created within step (2).

So I reproduced this "finding" as follows:
- I started with an image which is the result of step (1): Image_withXMP.jpg
- I created an argument file with all command options that my application sends to Exiftool in step 2: step2.args
  To this file I added the option -v3
- Now I called Exiftool from DOS-box: <path>/exiftool.exe -@ step2.args >out_step2.txt
  All files, except Exiftool, are inside the current directory of DOS-box.

This outputfile contains many lines with: Writing IPTC:<tag> if IPTC exists
but also: Writing IPTC:DateCreated on line 1872
Starting with line 2289 it says: Creating APP13:  -  Creating Photoshop  -  Creating IPTC  -  + IPTC:DateCreated = '20170628' ...

Now the image has the following IPTC block:
---- IPTC ----
Date Created                    : 2017:06:28
Time Created                    : 15:54:20+02:00
...<shortened>

Please have a look into this strange behaviour and please explain why Exiftool does create IPTC metadata while only EXIF-tags are to be deleted.
I feeled free to send all files via mail.

Thanks for your investigation in advance.
Best regards
Herb

Phil Harvey

Hi Herb,

I don't know exactly what your argfile contains, but add a -v3 to each of your commands to see in detail what ExifTool is doing.  You'll be able to then find the command that adds the IPTC, and you should be able to remove lines from the appropriate argfile until you find out what is actually causing the IPTC to be written.

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

Phil Harvey

I got the files you sent via email.

You are copying all tags without specifying a destination location so ExifTool will put the tags in their preferred location, some of which are in IPTC (especially since you enabled the MWG feature).

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

herb

Hello Phil,

Thanks for your answers and sorry for my late reply.

QuoteYou are copying all tags without specifying a destination location so ExifTool will put the tags in their preferred location
Sorry, but this comment is not clear to me, as I do not copy tags; I only delete EXIF-tags with -EXIF:tagname=

But nevertheless:
After many many hours of testing and analysing the strange problem, I was able to reduce it to the following question:
I have an *.jpg image out-of-camera from my Olympus E-PL6. This image does not contain any IPTC metadata nor does it contain any XMP metadata.

(0)
The following command exiftool.exe -EXIF:UserComment= image.jpg
deletes only the tag UserComment as expected.

(1)
But the command exiftool.exe -tagsfromfile @ -EXIF:UserComment= image.jpg
does the following:
- it deletes tag UserComment
- the PreviewImage becomes invalid
- Exif tags LensSerialNumber and SerialNumber are written to Exif and
- 18 XMP tags are newly created.

I retested also the scenario described in my first post.
Removing -tagsfromfile @ it worked as expected.

Now my question:
Why is it an error when my application also generates -tagsfromfile @?

Thanks again for your help in advance.
Best regards
Herb

Phil Harvey

#4
Quote from: herb on August 08, 2017, 08:37:01 AM
QuoteYou are copying all tags without specifying a destination location so ExifTool will put the tags in their preferred location
Sorry, but this comment is not clear to me, as I do not copy tags; I only delete EXIF-tags with -EXIF:tagname=

Your "step2.args" file contains a "-tagsfromfile @" without specifying any tags, so all tags are copied.

       -tagsFromFile SRCFILE or FMT
            Copy tag values from SRCFILE to FILE.  Tag names on the command
            line after this option specify the tags to be copied, or excluded
            from the copy.  Wildcards are permitted in these tag names.  If no
            tags are specified, then all possible tags (see note 1 below) from
            the source file are copied to same-named tags in the preferred
            location of the output file (the same as specifying "-all")
.  More
            than one -tagsFromFile option may be used to copy tags from
            multiple files.


- Phil

Edit: I think I see the source of confusion:  You don't want to copy any tags in your command (1), so you shouldn't be using -tagsfromfile @
...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 ($).

herb

Hello Phil,

Thanks for your help! All is clear now.

Best regards
Herb