Tag or Tags lost.

Started by calberga, July 07, 2015, 02:40:46 PM

Previous topic - Next topic

calberga

I have been working on tags on many of my image files.  For a number of reasons, including finding files with missing tags, I have run the following command on the collection for files.

exiftool -r -T -ext jpg -ReferenceNumber -directory -Filename -source -urgency -Caption-Abstract -CopyrightNotice -Country-PrimaryLocationName -Country-PrimaryLocationCode -F -L D:\P\Photographs > D:\P\X\D-Main-Tags-unsorted.txt


I had been having a lot of error messages about PreviewImage, so I tried

exiftool -TumbnailImage= -PreviewImage= -r -P -overwrite_original "D:/P/photographs/"

(Which just made matters worse, and I now get the error message on many more files! -- but that will be a different query.)

I then set various tags on sub-sets of the files and renamed some and moved some to new directories. I then ran this command:

exiftool -ext jpg "-comment<$directory/$filename" -overwrite_original -F -r -P -v0 "D:/P/photographs/" > D:/P/x/D-Savename.txt

On repeating the tag listing command above I found that two tags had vanished from one of the images.  The line for this file was, initially:

00058101   D:/P/Photographs/Relative's Portraits   2014-12-28 Richmond Virginia.jpg   -   4   -   Copyright (c) 2013 by Lydia Sonenklar, all rights reserved.   United States   USA

but had now become:

-   D:/P/Photographs/Relative's Portraits   2014-12-28 Richmond Virginia.jpg   -   4   -   Copyright (c) 2013 by Lydia Sonenklar, all rights reserved.   United States   -

With the ReferenceNumber and Country-PrimaryLocationCode tags having lost their values.

Note that none of the operations other than the updating of the -comment tag were performed on the file.

I don't have a copy of the file before this occured.

Does anyone have an idea as to what has happened here?

Phil Harvey

Both of the missing tags are IPTC.  Is there any IPTC left in the file?  It may help if you sent me the image so I could take a look (philharvey66 at gmail.com).

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

calberga

I've sent the file, with a note.  I just realized that there is one operation I use outside of exiftool that might effect tags.  I frequently use IrfanView's lossless rotation, to make portrait images "stand up".  This is because I heavily use IrfanView's Thumbnail display to rename and move images, and it doesn't pay attention to the Orientation tag (nor the MakeNotes:Rotation tag).  I have been setting Orientation to "Horizontal",  but was not aware of the Rotation tag, and thus they are currently holding conflicting values in the vertical photos!  I hope this isn't part of the problem.

Phil Harvey

Well, the IPTC is still there, so it isn't just that something wiped it out.  Something seems to have specifically targeted ReferenceNumber and Country-PrimaryLocationCode.  ExifTool will only do this if you delete these tags specifically, which I am assuming you didn't do.  So the only other option seems to be IrfanView.  You should try to reproduce the steps and see if IrfanView does this.

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

calberga

I will try, but I'm not sure what I might have done.  When I wish to set a specific value to a  tag in a bunch of images that are scattered in the file structure I move those files to a temp directory, run the tag setting command and the run:

exiftool -ext jpg -r -P "-filename<comment" D:/P/Working

Now you see why I have a full path & filename stashed in "comment"!

Sometimes I just use drag-and-drop from Windows Explorer (when whole directories are needed), and sometime I use the MOVE operation from IrfanView Thumbnails.  The trouble is, I don't think that image was involved in any of that between "looks".  The only operation I ran on the whole collection (abour four hours!) was:

exiftool -TumbnailImage= -PreviewImage= -r -P -overwrite_original "D:/P/photographs/"

I'm totally baffled.  I guess I just have to keep meticulous notes on what I'm doing (not something I'm very good at) and watch for vanishing tags.  Murphy's law strikes again.

Isn't there a compiler for the language exiftool is written in, to speed it up?  Or is it just disk access (reading writing large files) that makes it so slow?  Perhaps I should store all the "stuff" in the tags in a database, but the only one I have is Paradox, and it doesn't play well with special characters. 

Phil Harvey

For large images, ExifTool is limited by the write speed of the disk.  But for a lot of small images, the execution speed of Perl is more of a factor.  Unfortunately, there is no work-around for this.

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

StarGeek

In regards to Irfanview, when writing IPTC data, it doesn't understand the full range of IPTC tags and will only write tags it knows about.  So if you edit IPTC data with Irfanview, you might lose some data.  This is the case with both Country-PrimaryLocationCode and ReferenceNumber.

In my experience, the lossless rotation option in Irfanview doesn't touch any tag except the EXIF:Orientation tag.  I just double checked and both Country-PrimaryLocationCode and ReferenceNumber survived lossless rotation, only to be lost with the editing of the IPTC data.
"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