Author Topic: Append or prepend  (Read 11074 times)

Offline martink

  • Member
  • **
  • Posts: 59
    • View Profile
Append or prepend
« on: October 09, 2007, 12:15:52 PM »
Using the IPTC stationery pad offers the opportunity to append data in certain fields ie to add to the caption after the text already there.
Is there a way of adding to the front / top of the existing caption ?
Many thanks ... Martink

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Append or prepend
« Reply #1 on: October 09, 2007, 12:37:22 PM »
Martin,

Using the IPTC stationery pad offers the opportunity to append data in certain fields ie to add to the caption after the text already there.
Is there a way of adding to the front / top of the existing caption ?

No, there is no way to prepend text currently.

-Kirk

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Append or prepend
« Reply #2 on: October 10, 2007, 02:31:40 AM »
Kirk, I thought I had a work-around by using e.g. "Text to prepend {caption}" in the caption field.  This, however, produces "Text to prepend Text to prepend {caption}" in the caption field...
I guess the evaluation of the {caption} variable is done after you have already assigned the new value.  I noted this behaviour with the other fields as well so this is consistent.  A solution would be to perform the evaluation of the new value (e.g., from the IPTC stationary) first, that is before assigning it.  To me this sounds like the ideal solution as it would allow for lots of other uses as well (e.g., setting a field to parts of the original value, etc.)  I'm not sure if this would break other uses though...

Note: using the current 4.5.3 beta
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Append or prepend
« Reply #3 on: October 10, 2007, 07:14:57 AM »
Hayo,

Kirk, I thought I had a work-around by using e.g. "Text to prepend {caption}" in the caption field.  This, however, produces "Text to prepend Text to prepend {caption}" in the caption field...
I guess the evaluation of the {caption} variable is done after you have already assigned the new value.  I noted this behaviour with the other fields as well so this is consistent.  A solution would be to perform the evaluation of the new value (e.g., from the IPTC stationary) first, that is before assigning it.  To me this sounds like the ideal solution as it would allow for lots of other uses as well (e.g., setting a field to parts of the original value, etc.)  I'm not sure if this would break other uses though...

Note: using the current 4.5.3 beta

Yes, it would definitely break other usages.  There is a very specific order of evaluation that must be used in order for all things to flow through properly.

-Kirk

Offline vAfotoriporter

  • Uber Member
  • ******
  • Posts: 1046
    • View Profile
    • Attila Volgyi photojournalist
Re: Append or prepend
« Reply #4 on: October 10, 2007, 03:33:13 PM »
Kirk, I thought I had a work-around by using e.g. "Text to prepend {caption}" in the caption field.  This, however, produces "Text to prepend Text to prepend {caption}" in the caption field...
I guess the evaluation of the {caption} variable is done after you have already assigned the new value.

But you may use substrings since you know how long yor "Text to prepend " is. You also know that it will be prepended twice so you simply cut the first one having "Text to prepend {caption:16,100}".

Of course you need to know the length of your original caption as well or you may use a blind guess. Or you could use it if there would be a variable for the string length of a field....but there isn't as I know.
Working on Mac, OSX, iOS and with some Canons.
Allways shooting RAW.

http://www.volgyiattila.hu

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Append or prepend
« Reply #5 on: October 11, 2007, 02:46:04 AM »
Kirk, I thought I had a work-around by using e.g. "Text to prepend {caption}" in the caption field.  This, however, produces "Text to prepend Text to prepend {caption}" in the caption field...
I guess the evaluation of the {caption} variable is done after you have already assigned the new value.  I noted this behaviour with the other fields as well so this is consistent.  A solution would be to perform the evaluation of the new value (e.g., from the IPTC stationary) first, that is before assigning it.  To me this sounds like the ideal solution as it would allow for lots of other uses as well (e.g., setting a field to parts of the original value, etc.)  I'm not sure if this would break other uses though...

Yes, it would definitely break other usages.  There is a very specific order of evaluation that must be used in order for all things to flow through properly.

Kirk, this sure is a pity :'(

Is there perhaps (I'm stretching this, I know  ;)) another solution possible?  I'm thinking of a variable "modifier" that tells it to use the original value.  Something like an underscore or at character in front of the variable name (e.g., {_caption} or {@caption}) meaning the original value of the field, prior to the evaluation/update.
This would mean copying all variables to a second set prior to the evaluation/update though, but I think this would certainly work.

What do you think?
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline vAfotoriporter

  • Uber Member
  • ******
  • Posts: 1046
    • View Profile
    • Attila Volgyi photojournalist
Re: Append or prepend
« Reply #6 on: April 27, 2008, 04:30:57 PM »
I run into this prepending problem more and more often making me courious: will there be any solution to this problem?
Working on Mac, OSX, iOS and with some Canons.
Allways shooting RAW.

http://www.volgyiattila.hu

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Append or prepend
« Reply #7 on: April 27, 2008, 08:11:29 PM »
I run into this prepending problem more and more often making me courious: will there be any solution to this problem?

It would be good to provide the ability to choose what the '+' checkbox does.  If there were another setting along side the '+' checkbox, one could choose whether '+' means prepend or append.

-Kirk


Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Append or prepend
« Reply #8 on: May 01, 2008, 02:11:39 AM »
Kirk, if you go to that length, perhaps you could also implement adding a divider character (e.g., a space), only if the filed already contained data.

Yeah, I know, I'm stretching things  ;D
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline mbbphoto

  • Sr. Member
  • ****
  • Posts: 312
    • View Profile
Re: Append or prepend
« Reply #9 on: May 02, 2008, 09:12:33 AM »
I run into this prepending problem more and more often making me courious: will there be any solution to this problem?

It would be good to provide the ability to choose what the '+' checkbox does.  If there were another setting along side the '+' checkbox, one could choose whether '+' means prepend or append.

-Kirk



Yes please...
Marc

Offline sydlow

  • Newcomer
  • *
  • Posts: 31
    • View Profile
Re: Append or prepend
« Reply #10 on: March 31, 2012, 06:20:00 PM »
I run into this prepending problem more and more often making me courious: will there be any solution to this problem?

It would be good to provide the ability to choose what the '+' checkbox does.  If there were another setting along side the '+' checkbox, one could choose whether '+' means prepend or append.

-Kirk
I agree - being able to prepend in fields especially caption and headline would be great.

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Append or prepend
« Reply #11 on: April 02, 2012, 06:43:36 AM »
I run into this prepending problem more and more often making me courious: will there be any solution to this problem?

It would be good to provide the ability to choose what the '+' checkbox does.  If there were another setting along side the '+' checkbox, one could choose whether '+' means prepend or append.
I agree - being able to prepend in fields especially caption and headline would be great.

Version 5 will offer the ability to prefix, replace, or append on the caption field.

-Kirk

Offline Luiz Muzzi

  • Hero Member
  • *****
  • Posts: 704
    • View Profile
    • Luiz Muzzi Photography
Re: Append or prepend
« Reply #12 on: April 03, 2012, 03:42:46 AM »
That's really good news!
regards,

-Luiz Muzzi