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 2020-04-28 19:27:52

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Auto calculated image dimensions

Hello,
Currently on the photo legend in the viewer, I display the pixel dimensions of the photos like this:
"Dimensions: 5658 x 6880 px"


On the other hand is there a means/a method allowing to make an automatic calculation to display the resulting size at 300dpi in this way?:

"Dimensions: 5658 x 6880 px | 47,9 x 58,3 cm | 18,9 x 22,9 inches | 300dpi"


thank you in advance
Nico

Offline

#2 2020-04-28 21:33:43

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Auto calculated image dimensions

So for recap:

Dimensions: 5658 x 6880 px | 47,9 x 58,3 cm | 18,9 x 22,9 inches | 300dpi

--> 5658/300 = 18,86 inches

--> 18,86 x 2,54 = 47,9 cm


should it work?

Native dimensions: {CroppedWidth} x {CroppedHeight}px | ({CroppedWidth}/300)*2.54 x ({CroppedHeight}/300)*2.54 cm | {CroppedWidth}/300 x {CroppedHeight}/300 inches | 300dpi

Last edited by Nico3939 (2020-04-28 22:28:02)

Offline

#3 2020-04-29 00:12:09

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Auto calculated image dimensions

everything outside of the brackets is considered text and is printed as is.
You'd have to use LUA: http://backlight.theturninggate.net/doc … lua__token
But I don't know if LUA in Lightroom allows math functions (and I don't know what function it would be)


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#4 2020-04-29 01:48:01

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: Auto calculated image dimensions

This turned out more challenging as expected, although the result looks rather straightforward wink

Native dimensions: {CroppedWidth} x {CroppedHeight}px | {LUA= return math.floor(CroppedWidth/300*2.54)} x {LUA= return math.floor(CroppedHeight/300*2.54)} cm | {LUA= return math.floor(CroppedWidth/300)} x {LUA= return math.floor(CroppedHeight/300)} inches | 300dpi

Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

#5 2020-04-29 01:58:48

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: Auto calculated image dimensions

And this is with two decimal points:

Native dimensions: {CroppedWidth} x {CroppedHeight}px | {LUA= return string.format("%.2f",CroppedWidth/300*2.54)} x {LUA= return string.format("%.2f",CroppedHeight/300*2.54)} cm | {LUA= return string.format("%.2f",CroppedWidth/300)} x {LUA= return string.format("%.2f",CroppedHeight/300)} inches | 300dpi

Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

#6 2020-04-29 02:27:51

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Auto calculated image dimensions

very cool Daniel. I got to learn something new today!!


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#7 2020-04-29 02:32:45

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Auto calculated image dimensions

Amazing Daniel thank you very much it works great!

One last question, is it possible to do a Carriage return?

Last edited by Nico3939 (2020-04-29 05:02:25)

Offline

#8 2020-04-29 04:23:56

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Auto calculated image dimensions

no. html cannot be used in caption fields.

Last edited by rod barbee (2020-04-29 04:26:56)


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#9 2020-04-29 04:34:56

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Auto calculated image dimensions

Thanks Rod, but it seems we can make a line break in LUA by using  "\n" or "\r"

But it don’t work or I forget something

Offline

#10 2020-04-29 05:22:41

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Auto calculated image dimensions

I Googled about and saw that the \ character is not allowed in some platforms.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#11 2020-04-29 05:40:03

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: Auto calculated image dimensions

rod barbee wrote:

very cool Daniel. I got to learn something new today!!

Yeah, me too big_smile


Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

#12 2020-04-29 05:49:41

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: Auto calculated image dimensions

Nico3939 wrote:

Thanks Rod, but it seems we can make a line break in LUA by using  "\n" or "\r"

But it don’t work or I forget something

I think this has to do with the internal processing of Lr, Backlight, and the display engine where line breaks can break the code.


Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

#13 2020-04-29 17:19:34

chumby
Member
Registered: 2014-10-23
Posts: 188

Re: Auto calculated image dimensions

That is genius work, Daniel!

Well done!

Cheers,
Chumby

Offline

Board footer

Powered by FluxBB