Author Topic: Renaming / Duplicate Filename discussion  (Read 12672 times)

Offline Kevin M. Cox

  • Hero Member
  • *****
  • Posts: 545
  • PM 2024.10 (8173) | macOS 15.1
    • View Profile
    • Kevin M. Cox | Photojournalist
Renaming / Duplicate Filename discussion
« on: May 23, 2010, 03:14:43 PM »
Hey everyone, I've got a file renaming question that I know isn't new or unique but is something I've never run into before. I primarily shoot with EOS 1D Mark IINs that allow custom filenames straight out of the camera.

I've been helping my wife with more weddings recently so I added a second 5D Mark II to my arsenal last week. The problem this creates is that image names are stuck at IMG_XXXX with no ability to customize in camera.

I'm looking for the renaming solutions that others use in this situation. I know PM will gracefully append "A" to the end of duplicate filenames so I'm not worried about losing images or anything.

I don't think this is possible, but I'd love for PM to rename on Ingest using an "if" equation:  If serial # is XXXXXX rename KMC1_1234.jpg   If serial # is YYYYYYYY rename KMC2_1234.jpg  I imagine this would be fairly complicated to implement.

So here are the options I've thought of, please chime in with what I've missed.

RENAME ON INGEST:
{serialnum}-{filenamebase}
This will make for long filenames given the 5D2 serial but will make it obvious which camera made the photo.

{serialnum}-{frame}

RENAME LATER:
Alternatively I could live with the duplicate filenames with appended A on Ingest and rename later. Since PM can sort by Serial I can just highlight all from a given camera and then rename however I want such as: Cam1_{frame}

Am I correct that PM pulls this {frame} variable from within the EXIF and doesn't rely on the filename?

On a related note, Kirk I've noticed that PM can't report actuations for the 5D2. If it would help I can provide you with sample images where I know what the actuation should be for that frame. I'm not sure if that would help reverse engineer anything or not if you had sequential images to compare.

Thanks for the thoughts everyone.
Kevin M. Cox | Photojournalist
https://www.instagram.com/kevin.m.cox/

Offline mklass

  • Sr. Member
  • ****
  • Posts: 377
    • View Profile
    • Mick Klass Photography
Re: Renaming / Duplicate Filename discussion
« Reply #1 on: May 23, 2010, 05:02:12 PM »
Perhaps you could use a code replacement based on the camera serial number to tag which camera is which. I don't think PM has any I"f..then" logic evaluation capability.

Then you could use {frame} or {filename base} or what ever variable you think works best for the rest of the photo identifier.

Mick

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Renaming / Duplicate Filename discussion
« Reply #2 on: May 23, 2010, 09:01:12 PM »
Kevin,

I don't think this is possible, but I'd love for PM to rename on Ingest using an "if" equation:  If serial # is XXXXXX rename KMC1_1234.jpg   If serial # is YYYYYYYY rename KMC2_1234.jpg  I imagine this would be fairly complicated to implement.

You should be able to accomplish this pretty easily using Code Replacement.  Just create a file that looks like this:

XXXXX[tab]KMC1
YYYYY[tab]KMC2

'XXXXX' and 'YYYYY' should be replaced with the actual serial numbers your two bodies produce when using the {serial} variable.  Then rename with the following (I'm using '=' as the Code Replacement delimiter) during Ingest:

={serial}=_{frame4}

and that should do it.  There should be no collisions using this method.

Quote from: Kevin M. Cox
On a related note, Kirk I've noticed that PM can't report actuations for the 5D2. If it would help I can provide you with sample images where I know what the actuation should be for that frame. I'm not sure if that would help reverse engineer anything or not if you had sequential images to compare.

We talked to Canon representatives at the Winter Olympics in Vancouver and they stated that newer models like the 5D Mark II no longer store actuation counts in the photos.  The actuation count can only be read from the camera itself.

-Kirk

Offline Kevin M. Cox

  • Hero Member
  • *****
  • Posts: 545
  • PM 2024.10 (8173) | macOS 15.1
    • View Profile
    • Kevin M. Cox | Photojournalist
Re: Renaming / Duplicate Filename discussion
« Reply #3 on: May 23, 2010, 10:32:56 PM »
Wow!  I use code replacement all the time for cutlines but had no clue it worked for file renaming as well.  I'll give this a try, looks like it will solve my problem quite easily.

Out of curiosity, what will happen if I Ingest from a camera whose serial number I haven't added to the code replacement file? How will the delimiters effect the renaming, any chance for things to get messed up there?
Kevin M. Cox | Photojournalist
https://www.instagram.com/kevin.m.cox/

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Renaming / Duplicate Filename discussion
« Reply #4 on: May 24, 2010, 10:14:34 PM »
If the serial number is not yet in the code replacement file, the replacement will be (in Kirk's example) =zzzz=

Regards,
    Hayo
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline chipeast

  • Newcomer
  • *
  • Posts: 5
    • View Profile
Re: Renaming / Duplicate Filename discussion
« Reply #5 on: June 18, 2010, 10:46:30 AM »
Kirk:

This is a great tip but I am having a consistent problem with the output.

I'm using two different cameras, a Canon 1dM3 (top, below) and a Canon 5dM2 (bottom, below).  I set up the code replacement as you suggest:

123456   CE1
123456789   CE2

The serial numbers of the two cameras are different length (as represented above).

I'm using "={serial}=_{frame4}" in the "Rename Ingested Photos As" box in the lower right corner of the Ingest window.  Both cameras keep their proper four digit file number suffix from the original file name, but the renamed prefix, which should be "CE1" and "CE2" instead are "CE1\" and "CE2}" no matter if I have the files ingesting together or separated by camera. 

"_CE_0747.JPG"  from the 1dM3 turns into  "CE1\_0731.jpg"  and  "_MG_8450.JPG"  from the 5dM2 turns into  "CE2}_8450.jpg"

For my testing, I am ingesting from folder, not disc, and I have not tried from disc, but need this to work from files stored on my computer from several cameras.  The same strange character (either a \ for the 1dM3 or a } for the 5dM2) happens each time.

(Unfortunately, I'm recovering from back surgery so I'm not allowed to lift even the weight of a camera, so no way to shoot fresh pix and test from cards right now.)

Since in your example, you used three initials, I tried this in a fresh code replacement document, but other than adding the extra letter in the prefix, the \ or } were still added the same way.

Can you suggest anything to help avoid the extra character being added?

Many thanks......... Chip

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Renaming / Duplicate Filename discussion
« Reply #6 on: June 18, 2010, 11:52:12 AM »
Chip,

This is a great tip but I am having a consistent problem with the output.

I'm using two different cameras, a Canon 1dM3 (top, below) and a Canon 5dM2 (bottom, below).  I set up the code replacement as you suggest:

123456   CE1
123456789   CE2

The serial numbers of the two cameras are different length (as represented above).

I'm using "={serial}=_{frame4}" in the "Rename Ingested Photos As" box in the lower right corner of the Ingest window.  Both cameras keep their proper four digit file number suffix from the original file name, but the renamed prefix, which should be "CE1" and "CE2" instead are "CE1\" and "CE2}" no matter if I have the files ingesting together or separated by camera. 

"_CE_0747.JPG"  from the 1dM3 turns into  "CE1\_0731.jpg"  and  "_MG_8450.JPG"  from the 5dM2 turns into  "CE2}_8450.jpg"

For my testing, I am ingesting from folder, not disc, and I have not tried from disc, but need this to work from files stored on my computer from several cameras.  The same strange character (either a \ for the 1dM3 or a } for the 5dM2) happens each time.

(Unfortunately, I'm recovering from back surgery so I'm not allowed to lift even the weight of a camera, so no way to shoot fresh pix and test from cards right now.)

Since in your example, you used three initials, I tried this in a fresh code replacement document, but other than adding the extra letter in the prefix, the \ or } were still added the same way.

Can you suggest anything to help avoid the extra character being added?

Not yet.  I need to know a few things first.  What OS do you run Photo Mechanic on?  What version of Photo Mechanic are you running?  And lastly, can you post your code replacement text file?

Thanks,

-Kirk

Offline chipeast

  • Newcomer
  • *
  • Posts: 5
    • View Profile
Re: Renaming / Duplicate Filename discussion
« Reply #7 on: June 18, 2010, 04:22:15 PM »
Kirk:

Thank you for the quick reply....

I'm using PM 4.6.1 on OS-X 10.5.8.

Please check your email for the code replacement file.

Thanks again....... Chip

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Renaming / Duplicate Filename discussion
« Reply #8 on: June 18, 2010, 05:02:57 PM »
Chip,

Thank you for the quick reply....

I'm using PM 4.6.1 on OS-X 10.5.8.

Please check your email for the code replacement file.

Got it.  The main issue is that your file is a "Rich Text Format" file and is not a plain text file.  The \ and } characters are part of the formatting codes of the Rich Text Format file.  Re-saving the file as plain text should solve your problem.

Also, please upgrade to Photo Mechanic 4.6.4 as it fixes a number of bugs and enhances the capabilities in Code Replacement.  It is a free update for all 4.6.x users.

-Kirk