Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2016-07-18 15:01:46

RobS
Member
Registered: 2013-09-01
Posts: 166

Request: Please add 'Filename number suffix' Metadata Token

Request: Please add 'Filename number suffix' Metadata Token in Publisher

Offline

#2 2016-07-18 18:24:00

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Request: Please add 'Filename number suffix' Metadata Token

Hi Rob, I've added some tokens for this in the working Backlight code.  After doing so I found that it's actually possible to do now in either CE4 or Backlight, using LUA expressions.

For example, if you have a Photo with filename such as Photo_00123.jpg, the following token will output 123:

{LUA=if Filename ~= "" then return string.match(Filename, '[1-9][0-9]*$') end}

The following token will output 00123:

{LUA=if Filename ~= "" then return string.match(Filename, '[0-9]+$') end}

The rule for both of those lines of code is that any digits at the end of the filename excluding extension will be output.  So it should work with Filenames such as:  Photo123.jpg, Photo-123.jpg, Photo_123.jpg, Photo000123.jpg, etc.

Is that what you're looking for?

Offline

#3 2016-07-18 18:30:19

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Request: Please add 'Filename number suffix' Metadata Token

Further to the above, the output from the above lines of code will be achievable with the simpler tokens {NumericFilenameSuffix} and {NUMERICFILENAMESUFFIX} with the next update to Backlight.

Offline

#4 2016-07-18 19:22:22

RobS
Member
Registered: 2013-09-01
Posts: 166

Re: Request: Please add 'Filename number suffix' Metadata Token

Thanks Ben, that's great.

I tried putting the LUA code in the Metadata Token box in Lightroom, and uploaded the template. It still shows the filename. Do I need to change something in the Client Response Setup>Image Info section, too? Thanks.

Offline

#5 2016-07-18 20:23:30

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Request: Please add 'Filename number suffix' Metadata Token

Hi Rob,  have you republished the photos?  That's the only way the backend can get the updated metadata.
Make sure that you select the Publisher setting 'Push metadata without updating existing photos' so that the republishing is speedy.

Offline

#6 2016-07-18 20:32:22

RobS
Member
Registered: 2013-09-01
Posts: 166

Re: Request: Please add 'Filename number suffix' Metadata Token

Sweet! It works. Thanks Ben.

Offline

#7 2016-07-18 20:52:31

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Request: Please add 'Filename number suffix' Metadata Token

Excellent!  We have Jeffrey Friedl to thank for his excellent code behind the metadata handling.

Offline

Board footer

Powered by FluxBB