How to save file name into metadata?

Started by Jom, July 14, 2019, 02:33:15 PM

Previous topic - Next topic

StarGeek

 :o
C:\>curl.exe -s "http://130.15.24.87/pics/wheelbarrow.jpg"| exiftool -j - -G1 -xmp:all -iptc:all -exif:all
[{
  "SourceFile": "-",
  "IFD0:XResolution": 1,
  "IFD0:YResolution": 1,
  "IFD0:ResolutionUnit": "None",
  "IFD0:YCbCrPositioning": "Centered",
  "ExifIFD:ExifVersion": "0232",
  "ExifIFD:DateTimeOriginal": "8 monkeys",
  "ExifIFD:ComponentsConfiguration": "Y, Cb, Cr, -",
  "ExifIFD:FlashpixVersion": "0100",
  "ExifIFD:ColorSpace": "Uncalibrated"
}]


I was just overthinking things.  My thought process was to use something like -d "%S" and totally forgot that you can just write the value.
"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

Jom

1.
QuoteExiftool has to already know about it...
Aha, ExifTool сan recognize only those tags that he has inside, that he knows?
If I create a new tag, should I tell ExifTool about this in the configuration. I Understand, thanks.

2.
Quote...but Adobe uses it to store the original filename...
I realized that any creator of software can use tags in its own way, despite the standard? So you need to carefully select your software and do not change it without testing.

3.
QuoteThe stock image company GettyImages has designed their own tags for this purpose, XMP:CameraFilename and XMP:OriginalFileName.  I'm am not aware of any program outside of GettyImages that actually uses this tag.  Adobe also has XMP:RawFileName, of which I know nothing.
Why don't you do that?
-r -P -overwrite_original -wm cg -progress "-IPTC:ObjectName<Filename" "-XMP:Title<Filename" "-XMP:PreservedFileName<Filename" "-XMP:CameraFilename<Filename" "-XMP:OriginalFileName<Filename" "-XMP:RawFileName<Filename"

4.
QuoteMy DAM (Digital Assets Magangement)
What does your DAM look like? What is it?

As a result, I understand that I will have to study the basics of all standards, understand their ecosystem. ???

Jom

QuoteNot silly at all:
Да, забавно. Смешные обезьянки.  Вот она, неожиданная реальность. :)
Creating a system, you need to take into account even the most ridiculous case.

StarGeek

Quote from: andreikorzhyts on July 16, 2019, 03:48:12 PM
1.
QuoteExiftool has to already know about it...
Aha, ExifTool сan recognize only those tags that he has inside, that he knows?
If I create a new tag, should I tell ExifTool about this in the configuration. I Understand, thanks.

Well, partially.  It can only write to tags it knows about.  It can often recognize that there are other tags in the file (see the -u option) but may not show them.  XMP tags have the name of the tag built in, so exiftool can always display them, but can't write them without a definition.

Quote2.
Quote...but Adobe uses it to store the original filename...
I realized that any creator of software can use tags in its own way, despite the standard? So you need to carefully select your software and do not change it without testing.

Yes and it depends.  On the second point, most people don't care too much about the metadata.  You have to decide how you want to handle it.

QuoteWhy don't you do that?
-r -P -overwrite_original -wm cg -progress "-IPTC:ObjectName<Filename" "-XMP:Title<Filename" "-XMP:PreservedFileName<Filename" "-XMP:CameraFilename<Filename" "-XMP:OriginalFileName<Filename" "-XMP:RawFileName<Filename"

Because I don't have software that accesses those other tags and prefer not to have excess metadata.  An example of this is EXIF:ImageDescription, IPTC:Caption-Abstract, and XMP:Description.  All three have the same purpose, a description of the contents of the image.  But I purposefully clear EXIF:ImageDescription because I don't have a program (other than exiftool) that can edit that field and haven't come across a program that does.  It's wasted space and I like keeping my metadata as simple as possible.

Quote4.
QuoteMy DAM (Digital Assets Magangement)
What does your DAM look like? What is it?

I use a combination of Imatch 3, Imatch 5, and Google's Picasa.  The older Imatch 3 is my main interface for sorting, tagging and other file related operations.  It's just easier and faster with my large database than the newer Imatch 5.  Imatch 5 is just awesome for browsing various ways of my categorization, whether it's through keywords or locations or dates.  Also searching through tons of metadata easily.  I just don't care for the way it moves files around.  Picasa is there only for its facial recognition ability.

In all cases, none of these programs are allowed to write any data to my files.  That is all done through exiftool.

My directory structure is simple.  Files are a simple YYYY-MM-DD_HH.mm.ss, with an addition counter number for those images that were taken in the same second.  I also get images from some photographer friends.  Their images have their initials as a prefix.  The actual directories are basically Event->Year.  For example, I often go to comic conventions (San Diego Comic Con tomorrow!) so the main directory would be "San Diego Comic Con"  For multi-day events, I'll add more directories.  So the result for my photographs this week will be "San Diego Comic Con->2019->Day_1_(07-18)" for this Thursday.

"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

Jom

Спасибо, СтарГик (StarGeek).

QuoteIn all cases, none of these programs are allowed to write any data to my files.
How do you implement it? In the settings or just don't use their features?

StarGeek

Mostly I just don't use the features.  Picasa will corrupt the MakerNotes of a Nikon image.  Imatch adds a lot of extra stuff I don't find the need or use for, but it does have scripting ability, so the one thing I do use it for, it just calls exiftool from a script.
"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

Jom

Quoteso the one thing I do use it for, it just calls exiftool from a script.
:)

Спасибо за ответы.

Stephen Marsh

Adobe Bridge's Batch Rename Tool uses the PreservedFileName tag to recover/restore the original filename, which is useful to recover from a mistake or simply if one changes their mind. I often use one of the following variations.


Add/Copy filename to Adobe Preserve Original Filename (excluding file extension):

exiftool '-XMP-xmpMM:PreservedFileName<${filename;s/\.[^.]*$//}' -r 'FILEorDIR'


Add/Copy filename to Adobe Preserve Original Filename (including file extension):

exiftool '-XMP-xmpMM:PreservedFileName<${filename}' -r 'FILEorDIR'


Rename files using their preserved filename metadata entry:

exiftool '-FileName<XMP-xmpMM:PreservedFileName' -r 'FILEorDIR'

Jom

QuoteAdobe Bridge's Batch Rename Tool uses the PreservedFileName tag to recover/restore the original filename...
Thanks, this is useful information (about this was also written by StarGeek). I'm also use Adobe Brige for title, description and keywords.

StarGeek

Stephen is the one who made me aware of that tag and I felt it was useful enough to add it to my workflow.
"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

Jom

QuoteStephen is the one who made me aware of that tag and I felt it was useful enough to add it to my workflow.
Справедливость восстановлена.  :)

Jom

What difference betwen
exiftool '-XMP-xmpMM:PreservedFileName<...
and
exiftool '-XMP:PreservedFileName<...
?

StarGeek

XMP-xmpMM is the actual namespace that PreservedFileName belongs to (see XMP xmpMM Tags).  For all practical purposes, the commands are identical.

There are occasions where there are tag names that are duplicated in the same group.  For example, Adobe created the tag XMP-aux:LensInfo.  But along came the official EXIF tag XMP-exifEX:LensInfo.  If you want to write to XMP:LensInfo, then exiftool will prefer to write to XMP-exifEX:LensInfo and avoid writing to XMP-aux:LensInfo.  But if you specifically wanted to write the later tag instead, you would have to give it the full name.

I usually just name the group (XMP, IPTC, EXIF) where I want the tag to be written to and let exiftool decide which tag to actually write to because I feel the Phil has done all the proper research on which tags are more widely used.  It also helps to cut down on any mistake I might make if I transpose or drop a letter by accident.

"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

Jom

QuoteI realized that any creator of software can use tags in its own way, despite the standard? So you need to carefully select your software and do not change it without testing.
If I create my tag in the configuration file, no program will be able to see it and I will not worry about the impact of other programs on my tag?

obetz

Quote from: andreikorzhyts on July 14, 2019, 02:33:15 PM
I'm have file name IMG_0012, but it is not in metadata.

At least for my Canon DSLR, the "file index" is in the metadata, so you can reconstruct IMG_0012 at any time.

Oliver