PDA

View Full Version : Problems with file renaming and %r4 in IPTC data



GuyScharf
December 29th, 2005, 03:46 PM
I am using DLP 1.7. Files are from Nikon cameras (D70, D200), so have file names like DSC_0123.NEF or _DSC0123.NEF.

I want to rename the "DSC" to indicate the specific camera. So, using the D70 as an example, I set the file name to be %T8_%r4. This changes DSC_0123.NEF to D70_0123.NEF, which is exactly what I want.

Two problems:

1) I also place the file name in the IPTC Object Name field. If I put %T8_%r4 in this field, I end up with D70_01234 in the field. The .NEF isn't there, which is fine. But where did that extra "4" come from???

However, if I use %r instead of %r4, I get the desired result (D70_0123).

This appears to be a case of %r4 not working as documented for IPTC data.

However, since I always have exactly 4 digits (at this time anyway, with Dxx_0123 format), it appears that %r and %r4 are the same thing?

But see last point to derail this solution in the general case. :)

2) If I set a Nikon camera to use AdobeRGB color space, it changes the form of the file name from DSC_0123.NEF to _DSC0123.NEF. I'd like to preserve that leading vs trailing underscore. E.g., I want to rename DSC_0123 to D70_0123 and _DSC0123 to _D700123.

How might I do that?

3) The D200 also allows the user to change the DSC string to just about anything else. I might want to change mine to be "D20" to indicate the camera in the file name. That results in file names like D20_0123, which works fine with %T8_%r token string. However, with AdobeRGB, the file name generated by the camera would be _D200123, and %T8_%r becomes an undesirable long name (I think it picks up 5 digits?).

I think this argues for making the %r4 token work as expected in the IPTC data.

Thanks!

Guy

Chris Breeze
January 2nd, 2006, 03:12 PM
Sorry, it looks like a bug when expanding %r4 for the IPTC data. I'll fix this in the next update.

The DCF filenaming standard allows up to 5 digits in the file number and so %r will pick up the last five digits if you name your files _D201234.JPG. I don't know if the D200 shifts the prefix to give _D20, truncates it to _20 or _D2 when adding _ for AdobeRGB. I suspect it ought to use D20 for sRGB and _20 for AdobeRGB.

%f returns the first three characters of the filename and will preserve the leading _ from AdobeRGB images.

GuyScharf
January 2nd, 2006, 08:25 PM
I don't know if the D200 shifts the prefix to give _D20, truncates it to _20 or _D2 when adding _ for AdobeRGB. I suspect it ought to use D20 for sRGB and _20 for AdobeRGB.
fyi, Nikon uses a prefix of "DSC_" for sRGB and "_DSC" for AdobeRGB. Only four digits are used for the sequence number.

If you change the string "DSC" to "D20", then the prefixes are "D20_" and "_D20" respectively.

Realistically, I will always shoot with the same color space, so I don't really need to distinguish between the two settings when using DLPro. If %r4 works in the IPTC data, that will cover all situations that I really need to handle.

Guy

Chris Breeze
January 3rd, 2006, 11:23 AM
I checked the DCF standard and it states that the first 4 characters of the filename are alphanumeric and the remaining four are digits defining the image number. So Nikon's approach of naming the files DSC_1234.JPG or _DSC1234.JPG does appear to conform to the standard and also makes more sense than Canon's naming which gives IMG_1234.JPG or _MG_1234.JPG.