ExifTool Forum

ExifTool => Newbies => Topic started by: sak1364 on March 30, 2025, 08:37:22 PM

Title: hidden filename
Post by: sak1364 on March 30, 2025, 08:37:22 PM
It looks like ExifTool is a bit above my head. But I have a problem I'm wondering if it would help me with.

I am running on a Mac. I just finished scanning more than 1400 35mm slides using SilverFast. I had to scan them in groups of 10 - 50. For each group I had SilverFast name the files sequentially (Scan-1, Scan-2, Scan-3...). After that I renamed the files in each group using a renaming app.

Now when I open them in SilverFast to edit them, SilverFast uses the original name (Scan-1, Scan-2, Scan-3...). And when SilverFast exports the edited files it names them using the original filename. I was able to find that original name using a website meta data viewer, so I know it's there. The macOS Finder, Apple Photos and Adobe Bridge only show the new name not the original.

The software company's explanation is not real clear to me but has something to do with "reasons of not confusing names." I plan to have SilverFast process all 1400 files in 1 batch. The main problem is, many will have the same name (Scan-1, Scan-1 1, Scan-1 2, Scan-1 3,...). It will take forever to correct the names because I will have to do them one at a time searching the entire catalog to find the right image name.

My question is, can ExifTool find that original name and change it to the new so that SilverFast will use that instead? And if so, can it automatically go through all 1400+ files and do that?

Thanks
-Scott
Title: Re: hidden filename
Post by: Phil Harvey on March 30, 2025, 09:13:17 PM
Hi Scott,

I can't answer that without knowing where Silverfast wrote the name,
but the answer is likely yes, but I don't have time right now to walk you through the required steps.

- Phil
Title: Re: hidden filename
Post by: wywh on March 31, 2025, 02:28:42 AM
Post a sample image here so we can take a look. Tell us what filename SilverFast insists using for that image.
Title: Re: hidden filename
Post by: sak1364 on April 01, 2025, 05:11:24 PM
Thank you very much! I was wondering if I should have attached a file. The files are too big to attach here so I'll put a dropbox link below. It will be available for 3 days.

The first file is "Yellowstone 8.2.08-D31.dng". SilverFast uses the name "Scan-129". When I upload that to an online metadata viewer I can find this text string in 2 locations:
    <Name>Scan-129</Name>

The second file is "Germany 4.10.05-F30.dng". SilverFast uses the name "Germany -23". (Note the space.) The online viewer shows:
    <Name>Germany%20-23</Name>

It looks like SilverFast does not store the .dng extension with the original name. I also see that the original file location is stored here, too. But that doesn't seem to matter. SilverFast is able to open the files even though they are in different locations now.

Most of the files used the naming convention "Scan-x" where x will be one to three digits long.

I have a very basic understanding of the HTML that I'm seeing in the metadata. But I have very little experience using command line instructions in Terminal. So this is where I start getting in over my head. And I appreciate the help more than I can say.

Am I correct that ExifTool will be able to find the "Scan-x" text regardless of the value of x, and replace it with the current filename (without the extension)?

https://we.tl/t-hknPK970VM (https://we.tl/t-hknPK970VM)
Title: Re: hidden filename
Post by: Phil Harvey on April 02, 2025, 07:47:44 AM
The file name is stored inside the XML of the XMP-Silverfast:ScanFrames tag.  Unfortunately ExifTool as distributed doesn't have the ability to write this tag, so we will need a config file to create a user-defined tag.  The following command will change the "Scan-###" Name entry to "Germany -23" using the attached config file.

exiftool -config silverfast.config "-scanframes<${scanframes;s(<Name>Scan-\d+</Name>)(<Name>Germany -23</Name>)}" FILE

ExifTool will handle escaping the space in "Germany -23" with a "%20".

- Phil
Title: Re: hidden filename
Post by: Phil Harvey on April 02, 2025, 08:01:51 AM
Oh, right.  You want the name of the current file and not just a fixed name.  That makes the command more complex:

exiftool -config silverfast.config "-scanframes<${scanframes;my $fn=$self->GetValue('FileName');$fn=~s(\.[^.]+$)();s(<Name>Scan-\d+</Name>)(<Name>$fn</Name>)}" FILE

- Phil
Title: Re: hidden filename
Post by: StarGeek on April 02, 2025, 04:00:47 PM
One other thing that might would be to save the current filename into the file, and then rename afterwards.

To save
exiftool "-PreservedFileName<Filename" /path/to/files/

To restore
exiftool "-Filename<PreservedFileName" /path/to/files/
Title: Re: hidden filename
Post by: sak1364 on April 02, 2025, 06:27:51 PM
Thank you very much for the help. I'll give it a try as soon as I can.