Author Topic: Incorrect frame number from files edited in Capture NX2  (Read 8113 times)

Offline Martin Lamb

  • Newcomer
  • *
  • Posts: 11
    • View Profile
Incorrect frame number from files edited in Capture NX2
« on: July 10, 2011, 03:40:03 PM »
Hi,

This is my first post as a new forum member, and an inexperienced Photo Mechanic user.

I am running Photo Mechanic version 4.6.7 and I run Mac OS X 10.6.8 on my Intel-based MacBook Pro. I use Capture NX2 2.2.7 to edit raw files from my Nikon D700. Whilst using PM to rename a batch of files from ML2_nnnn.nef to ML3_nnnn.nef where nnnn is the frame/file number I found that files which had previously been saved from NX2 were given an incorrect frame number. My renaming string was ML3_{frame}. Original untouched files were handled correctly, but any previously saved from NX2 were given a seemingly random number. This also happened with jpegs saved from NX2.  Examining the "file info" of the NX2-saved files in PM shows the frame # as this incorrect value (sometimes with 5 digits). Running exiftool on the same files shows the correct expected result.

I don't know if this is a problem with PM or with the structure of the nikon files or with the user. Apologies if a solution to this has already been posted - I could not find it.

I attach some screen shots.

Regards

Martin





[attachment deleted by admin]

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 469
    • View Profile
    • Camera Bits, Inc.
Re: Incorrect frame number from files edited in Capture NX2
« Reply #1 on: July 11, 2011, 01:30:38 PM »
Hi Martin,

Looks like this value is stored in "big endian" (Motorola) format regardless of the endian format for the NEF file.  Nikon's cameras generally write "big endian" format but Capture NX2 saves NEF files as "little endian".  So PM was incorrectly swapping the bytes by assuming that all values were in the same global endian format.

So your file that was showing 28162 (0x6e02) should have been 622 (0x026e).

I'll update PM and this should be in the 4.6.8 beta.

Regards,

--dennis

Offline Martin Lamb

  • Newcomer
  • *
  • Posts: 11
    • View Profile
Re: Incorrect frame number from files edited in Capture NX2
« Reply #2 on: July 11, 2011, 03:43:20 PM »
Hi Dennis,

Many thanks for your quick response. Is it possible to do this without 'breaking' PM's treatment of the NEF files direct from the camera? These are working fine at the moment.

Regards

Martin

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 469
    • View Profile
    • Camera Bits, Inc.
Re: Incorrect frame number from files edited in Capture NX2
« Reply #3 on: July 11, 2011, 05:20:58 PM »
Many thanks for your quick response. Is it possible to do this without 'breaking' PM's treatment of the NEF files direct from the camera? These are working fine at the moment.

Hi Martin,

Yes PM will still work for camera NEFs in addition to supporting the image number for Capture NX2-saved NEFs (or JPEGs).

--dennis

Offline Martin Lamb

  • Newcomer
  • *
  • Posts: 11
    • View Profile
Re: Incorrect frame number from files edited in Capture NX2
« Reply #4 on: July 12, 2011, 01:16:23 AM »
Hi Dennis,

Thanks. That's great.

Martin

Offline Juerg

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: Incorrect frame number from files edited in Capture NX2
« Reply #5 on: July 12, 2011, 06:51:43 AM »
Martin,

I think as a work around you could use the renaming string with the {fbas} instead of {frame}.

"ML3_{fbas:-4}" should do it.

Regards
Juerg

Offline Martin Lamb

  • Newcomer
  • *
  • Posts: 11
    • View Profile
Re: Incorrect frame number from files edited in Capture NX2
« Reply #6 on: July 12, 2011, 01:11:19 PM »
Juerg,

Thanks. Works a treat.

Martin

Offline nikkoreye

  • Newcomer
  • *
  • Posts: 22
    • View Profile
Re: Incorrect frame number from files edited in Capture NX2
« Reply #7 on: July 13, 2011, 02:03:29 AM »
Hello, using {fbas:-4} only works initially but not after filenames have been mangled. It happened also to me when using Nikon ViewNX2 prior to PM. Incorrect frame numbers were displayed by PM after ViewNX 2 re-wrote the NEF but I could not never find these frame numbers in exiftool's output, so the explanation big/little-endian issue makes sense to me.

Offline Juerg

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: Incorrect frame number from files edited in Capture NX2
« Reply #8 on: July 13, 2011, 05:21:17 AM »
That's of course correct that the {fbas} work around only does it's job as long as the filename is not mangled. To correct the already wrongly named files I guess you guys have to wait for Dennis to work out a fix.

Juerg

Offline Martin Lamb

  • Newcomer
  • *
  • Posts: 11
    • View Profile
Re: Incorrect frame number from files edited in Capture NX2
« Reply #9 on: July 14, 2011, 06:51:53 AM »
Hi Nikkoreye, Juerg,

Luckily I had only a small number of files affected and the {fbas} workaround was fine for the rest. Nikkoreye, I duplicated the problem with ViewNX2 and was able to see the original frame number with exiftool. exiftool calls it File Number. Try the following from a terminal window, having changed directory to the appropriate folder.

exiftool -a *.NEF | grep "File N"

This will print out a list of the 'File Name' and 'File Number' for each file.

It should be possible to write a script to automatically rename the files! -- any script experts out there?

I hope this is helpful

Regards

Martin