Author Topic: a minor code replacement bug - or perhaps a feature??  (Read 4951 times)

Offline ron_hiner

  • Full Member
  • ***
  • Posts: 222
    • View Profile
a minor code replacement bug - or perhaps a feature??
« on: January 20, 2010, 08:46:27 PM »
This stumped me for a bit.. I thought my EXIF data was corrupted...   See the text next to the word 'capture'  and ITPC date in the info pane?  Yeah, well, that's supposed to be a date (9/03/09)  -- not random text.





I first checked the settings for the infopane...




That looks ok to me.   Well, I check the itpc data, and nothing strange there.  So I thought my image file was fine, or so I hoped.   But I kept digging.      I recognized that random text... it was from my code replacement file




It turns out the I had changed my code replacement delimiter to a '/' character (easier to type on my numeric keypad when entering code replacements)




So... it looks like the contents of variables are being evaluated for Code Replacements... which I'm not sure is a good thing... I have a code replacement of '09' and a delimiter of '/'  so when my dates have a '/03/' as they do from this shoot last september 3rd, the code replacement for my friend  '3 Zoe'  goes to work.  

Bug or a feature?  I don't know.   I'm trying to think of a case to use this as a 'feature' because it could be potentially very powerful.  

Ron

PM 4.6.2.1 running on OS X 10.5.8

« Last Edit: January 20, 2010, 08:49:08 PM by ron_hiner »

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: a minor code replacement bug - or perhaps a feature??
« Reply #1 on: January 21, 2010, 05:09:36 AM »
I'm not sure evaluating the content of variables for code replacements is a bug, or is intentional. But for now, why not change the code replacement delimiter to a backslash (\), or some other character, that would solve your problem for now too.

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

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25054
    • View Profile
    • Camera Bits, Inc.
Re: a minor code replacement bug - or perhaps a feature??
« Reply #2 on: January 21, 2010, 06:13:58 AM »
Ron,

So... it looks like the contents of variables are being evaluated for Code Replacements... which I'm not sure is a good thing... I have a code replacement of '09' and a delimiter of '/'  so when my dates have a '/03/' as they do from this shoot last september 3rd, the code replacement for my friend  '3 Zoe'  goes to work.  

Bug or a feature?  I don't know.   I'm trying to think of a case to use this as a 'feature' because it could be potentially very powerful.

It is absolutely a feature and exposes much of the power of Code Replacement.  Follow Hayo's advice and change your Code Replacement delimiter to something else like \, =, or *.  Something easy to type but not often used in things like dates.

-Kirk

Offline ron_hiner

  • Full Member
  • ***
  • Posts: 222
    • View Profile
Re: a minor code replacement bug - or perhaps a feature??
« Reply #3 on: January 21, 2010, 06:29:32 AM »
yes, of course, the workaround is self-evident...

but... code replacement's obvious use is typing in jersey numbers of sports players.    But... what else can it be used for?   What lurks in this box of Kirk's magic have I stumbled into?

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25054
    • View Profile
    • Camera Bits, Inc.
Re: a minor code replacement bug - or perhaps a feature??
« Reply #4 on: January 21, 2010, 07:02:06 AM »
Ron,

yes, of course, the workaround is self-evident...

but... code replacement's obvious use is typing in jersey numbers of sports players.    But... what else can it be used for?   What lurks in this box of Kirk's magic have I stumbled into?

See page 63 of the manual.  It gets into using variables with Code Replacement a bit.

Here is another scenario: instead of using Code Replacement directly for jersey numbers, you could enter the jersey numbers in a different field like Edit Status, without any Code Replacement delimiters in a first pass (which is quicker and more natural.)  Then when applying the IPTC Stationery Pad, each place you want to have the player's info displayed you would enter the following into that location:

\{status}\

And then apply the IPTC Stationery Pad.  Now each location will have the player's info.  Moreover if you have multiple pieces of information for the player mapped to a single code (see page 62 of the manual) you could do this:

\{status}#2\ or \{status}#3\

to access the extended information for that player.

Very powerful indeed.

-Kirk