Author Topic: Problems renaming twice using {frame4}  (Read 10478 times)

Offline lonc

  • Newcomer
  • *
  • Posts: 5
    • View Profile
Problems renaming twice using {frame4}
« on: December 13, 2006, 08:42:53 AM »
I made a mistake and renamed some photos with the following string:

xxx_{year2}{month}{day0}_{frame4}

I thought I would just rename the same photos again with the following string but {frame4} doesn't work on the 2nd try:

xxx_{year2}{month0}{day0}_{frame4}

Is this correct? The files were .CR2 files from a Canon 5D.

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24763
    • View Profile
    • Camera Bits, Inc.
Re: Problems renaming twice using {frame4}
« Reply #1 on: December 13, 2006, 01:13:32 PM »
I made a mistake and renamed some photos with the following string:

xxx_{year2}{month}{day0}_{frame4}

I thought I would just rename the same photos again with the following string but {frame4} doesn't work on the 2nd try:

xxx_{year2}{month0}{day0}_{frame4}

Is this correct? The files were .CR2 files from a Canon 5D.

Did you Ingest the CR2 files to get them onto your system?

-Kirk

Offline lonc

  • Newcomer
  • *
  • Posts: 5
    • View Profile
Re: Problems renaming twice using {frame4}
« Reply #2 on: December 13, 2006, 03:52:02 PM »
No, I just copied with the finder.

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24763
    • View Profile
    • Camera Bits, Inc.
Re: Problems renaming twice using {frame4}
« Reply #3 on: December 13, 2006, 05:32:07 PM »
No, I just copied with the finder.

OK, we're looking into it.

-Kirk

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 462
    • View Profile
    • Camera Bits, Inc.
Re: Problems renaming twice using {frame4}
« Reply #4 on: December 14, 2006, 12:09:10 PM »
The issue here is that the frame number is not always written into the file (Exif makernote).  So what Photo Mechanic does is to try and "infer" the frame number based-upon the filename, but this requires the 8 character filename that cameras write with the last four characters being digits.

If you copy a file (e.g. with Ingest) or otherwise cause PM to change the image preferences (e.g. tag it), then this inferred frame number will stick with the photo in the preferences and PM won't need to rely on the filename being formatted as above.

So, if didn't use Ingest (such that you are looking at original camera files) and renamed initially using the {frame4} variable, then you closed the contact sheet and then re-opened the same folder, the frame number will not be inferred and it will be blank.  If, however, you don't close the contact sheet, then PM should still be remembering the inferred frame number with the renamed photo.

So you might consider using Ingest in the future.  You might also want to tuck the original filename somewhere in the IPTC (e.g. put {filenamebase} into the Transmission Reference field).  Then later you can get back the original filename by renaming as {transref}.

--dennis

Offline lonc

  • Newcomer
  • *
  • Posts: 5
    • View Profile
Re: Problems renaming twice using {frame4}
« Reply #5 on: December 14, 2006, 03:53:30 PM »
Thanks Dennis, I understand what is going on now.

I am just curious, anyway the Update IPTC/XMP tool would help with this issue?

It would be cool if PM had a variable that allowed selecting the left or right x characters of the {filenamebase} or better yet any variable.

-Lon


The issue here is that the frame number is not always written into the file (Exif makernote).  So what Photo Mechanic does is to try and "infer" the frame number based-upon the filename, but this requires the 8 character filename that cameras write with the last four characters being digits.

If you copy a file (e.g. with Ingest) or otherwise cause PM to change the image preferences (e.g. tag it), then this inferred frame number will stick with the photo in the preferences and PM won't need to rely on the filename being formatted as above.

So, if didn't use Ingest (such that you are looking at original camera files) and renamed initially using the {frame4} variable, then you closed the contact sheet and then re-opened the same folder, the frame number will not be inferred and it will be blank.  If, however, you don't close the contact sheet, then PM should still be remembering the inferred frame number with the renamed photo.

So you might consider using Ingest in the future.  You might also want to tuck the original filename somewhere in the IPTC (e.g. put {filenamebase} into the Transmission Reference field).  Then later you can get back the original filename by renaming as {transref}.

--dennis

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24763
    • View Profile
    • Camera Bits, Inc.
Re: Problems renaming twice using {frame4}
« Reply #6 on: December 14, 2006, 04:59:10 PM »
Lon,

It would be cool if PM had a variable that allowed selecting the left or right x characters of the {filenamebase} or better yet any variable.

That is definitely coming in version 4.5.  I added that feature a few weeks ago.

Variables, substring extraction works like this:
{variable:start:count}

Where <start> is the zero-based index of the character you want to start extracting from, or use negative numbers to extract from the end. <count> is the number of characters to extract.

So you can do things like this:
   {filenamebase:0,5}  // extract five characters from filenamebase starting at character 0
   {filenamebase:-5,5} // extract five characters from the end of filenamebase
   {filenamebase:5,2} // extract two characters from character 5 of filenamebase

This makes it easy to grab substrings from variables and build new strings from them.

-Kirk

Offline lonc

  • Newcomer
  • *
  • Posts: 5
    • View Profile
Re: Problems renaming twice using {frame4}
« Reply #7 on: December 14, 2006, 08:58:13 PM »
Sounds very useful Kirk.

While I am wishing for things...how about a way to rename any characters in filenamebase that might cause cross platform or html issues. Things like * . " / \ [ ] : ; | = or hi-ascii characters, etc.

And, if we start doing all this renaming in PM a way to save and load rename strings would be helpful.

-Lon


Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24763
    • View Profile
    • Camera Bits, Inc.
Re: Problems renaming twice using {frame4}
« Reply #8 on: December 14, 2006, 09:42:51 PM »
Lon,

Sounds very useful Kirk.

While I am wishing for things...how about a way to rename any characters in filenamebase that might cause cross platform or html issues. Things like * . " / \ [ ] : ; | = or hi-ascii characters, etc.

In general, PM replaces any illegal characters you type with a '-', and any illegal characters that come from variables are automatically changed to '-' as well.

Quote from: lonc
And, if we start doing all this renaming in PM a way to save and load rename strings would be helpful.

That's what the Snapshot button is for (the button with the lightning bolt icon on it)...

HTH,

-Kirk

Offline lonc

  • Newcomer
  • *
  • Posts: 5
    • View Profile
Re: Problems renaming twice using {frame4}
« Reply #9 on: December 15, 2006, 06:02:17 PM »

In general, PM replaces any illegal characters you type with a '-', and any illegal characters that come from variables are automatically changed to '-' as well.
-Kirk


I guess we have to define what characters should really be legal. I am not sure any characters other than a-z and 0-9 and perhaps one or two others should ever be in a file name.

-Lon

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24763
    • View Profile
    • Camera Bits, Inc.
Re: Problems renaming twice using {frame4}
« Reply #10 on: December 15, 2006, 08:24:49 PM »
Lon,


In general, PM replaces any illegal characters you type with a '-', and any illegal characters that come from variables are automatically changed to '-' as well.

I guess we have to define what characters should really be legal. I am not sure any characters other than a-z and 0-9 and perhaps one or two others should ever be in a file name.

We allow all characters that do not cause problems with the filesystem.  High-bit characters are not an issue for the most part.  In version 4.5 you can rename your files with Japanese, Korean, Chinese, etc. characters with no problems at all.

Things like :, ?, *, /, \, ", <, >, and | are not allowed in folder names or file names.

HTH,

-Kirk