INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Caption display, photos  (Read 1289 times)

Daydream

  • Citizen of the Universe
  • *****
  • Posts: 772
Caption display, photos
« on: April 08, 2012, 05:04:26 pm »

What makes the Caption field being displayed in Panes view as some text here... instead of some text here that is going to be very long. What triggers the ellipsis instead of showing the complete field content, when there is enough space (width)?
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Caption display, photos
« Reply #1 on: April 08, 2012, 08:26:12 pm »

I think it is the newlines separating lines within the caption that cause this.  If the value is copied from, and pasted back into the Caption field, MC replaces newlines with spaces, and then it will display entirely.  You may not want this update in the actual file though if there would be interoperability problems with other programs (don't know much about this).

You can use an expression column:

  clean([caption],3)

to show the entire capture, with spaces replacing the newlines.  Non-destructive.  I don't think it is possible to specify a newline character in the expression language, or you would be able to have it replaced with comma, semicolon, or something else during display.
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Caption display, photos
« Reply #2 on: April 08, 2012, 10:01:15 pm »

Ok, if you need to replace the newline with something other than a space, let me know, and I'll provide instructions (I don't want to confuse and clutter the thread with probably unnecessary details.)
Logged
The opinions I express represent my own folly.

Daydream

  • Citizen of the Universe
  • *****
  • Posts: 772
Re: Caption display, photos
« Reply #3 on: April 09, 2012, 12:45:02 am »

Ok, if you need to replace the newline with something other than a space, let me know, and I'll provide instructions (I don't want to confuse and clutter the thread with probably unnecessary details.)

Please do. Any separator will be fine, no preferences.

To give more context, I'm on an (apparent) impossible task: I wanna populate the [Events] field with parts of the [Caption] field. Only that there is no rule, since what I'd pick as representative for an event name it's very much random. To make it much worse (this is where I hope I can work something out, with your help for the above) is that the captions appear really crazy with everything in one line (if I go to edit mode, otherwise ellipsis; artist, descriptions, photographer, agencies names, contact phone numbers, etc). If I could brake them apart / replace with a separator then I could aim (with some luck) to keep one 'line' and strip the rest - in other words I could see some patterns emerging.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Caption display, photos
« Reply #4 on: April 09, 2012, 02:51:52 pm »

Within MC, I can only give you a couple of newline replacements; MC is currently too limited in this area.

If we could replace all of them in one shot, with a semicolon, you'd be able to trivially assign the semicolon-separated list to Events, and then you could simply pick and chose which event keywords you want.

Until such time, here's what I would recommend, if you don't have another program that can reformat/rewrite the IPTC Caption/Description tags.

1) In a view, select the images for which you want to push converted Caption -> Event keywords.
2) Export this as an MPL playlist
3) run a script on the MPL playlist that replaces newlines with semicolons within only the Caption field, and then copies this field to a new Events field (or your own temporary Events field).
4) Import the playlist

At this point, Events is populated with a list, and you can deselect all undesired events keywords for one or more files.  I've confirmed this works.  See attached image - this was one Caption with many newlines, which I auto-converted to semicolon-separated list items.

Of course, (3) is the key - if this is outside your comfort zone, or you don't want someone else to convert it for you, I'm not sure what else to advise.
Logged
The opinions I express represent my own folly.

Daydream

  • Citizen of the Universe
  • *****
  • Posts: 772
Re: Caption display, photos
« Reply #5 on: April 09, 2012, 11:59:08 pm »

Much appreciated MrC! I can surely make it work; the overall idea actually helps to deal with a few other exceptions, so it's pretty cool overall, since I was having a creative block how to attack this.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Caption display, photos
« Reply #6 on: April 10, 2012, 12:06:19 am »

Great!

btw.  I'd created a little perl script to do the conversion:

Code: [Select]
$ cat ~/script.pl
#local $/;
$RS="\r\n";

$caption = undef;
while (<>) {
    s/\r\n/\n/g;
    chomp;
    if (/^<Field Name="Caption">/ .. /<\/Field>$/) {
        $caption .= "; " if $caption;
        $caption .= $_;
        next;
    }
    printf "$caption\r\n" if $caption;
    printf "$_\r\n";
    $caption = undef;
}
Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up