Copy file name to a file description?

Started by milan64586, March 02, 2021, 02:39:37 AM

Previous topic - Next topic

milan64586

Hello everyone,
I am a newbie and I have a question for you. For the last couple of months I was scanning my old paper photos. From the beggining I was thinking about how can I organize those photos at the end. While I was thinking, I was changing their names adding name of the people or the events in the file name. Now I want to add all those pictures to the google photos. But google photos CAN'T search pictures by its file names that I was made. So I found this application and hope it can work.

I need an option to copy ALL the file names to the file description in metadata, because than those names are going to the file description, which google photos recognize as a description, and than it becomes searchable.

So basically if the name of the picture is temp.jpg, I want that it copies "temp", or "temp.jpg" to the file description. I want that for ALL files (if possible at once). Is it possible and how? Thanks.


Phil Harvey

exiftool "-description<filename" DIR

or to remove the extension:

exiftool "-description<${filename;s/\.\w+$//}" DIR

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

milan64586

THANKS A LOT! :o It works like a charm! And this is exactly what I was looking for. Just one more question. It is not necessary but it would be perfect if possible. I have lot of sub-folders. Is it possible somehow to include all subfolders or I have to do this manually?

StarGeek

Assuming you CD into the top directory, the $Directory tag will hold the directory path.

Example

Y:\!temp\ccccc\p>exiftool -G -a -s -Directory -r .
======== ./1.jpg
[File]          Directory                       : .
======== ./Dir1/2.jpg
[File]          Directory                       : ./Dir1
======== ./Dir1/Dir2/3.jpg
[File]          Directory                       : ./Dir1/Dir2
======== ./Dir3/4.jpg
[File]          Directory                       : ./Dir3
    4 directories scanned
    4 image files read


The leading dot or dotSlash could be removed by using ${Directory;s(^\./?)()}

If you didn't CD into the directory, it would be more complicated.
"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

milan64586

Once again. Works like a charm! Amazing! Thanks one more time!