• Welcome to the Lightroom Queen Forums! We're a friendly bunch, so please feel free to register and join in the conversation. If you're not familiar with forums, you'll find step by step instructions on how to post your first thread under Help at the bottom of the page. You're also welcome to download our free Lightroom Quick Start eBooks and explore our other FAQ resources.
  • Stop struggling with Lightroom! There's no need to spend hours hunting for the answers to your Lightroom Classic questions. All the information you need is in Adobe Lightroom Classic - The Missing FAQ!

    To help you get started, there's a series of easy tutorials to guide you through a simple workflow. As you grow in confidence, the book switches to a conversational FAQ format, so you can quickly find answers to advanced questions. And better still, the eBooks are updated for every release, so it's always up to date.
  • 17 August 2022 It's Lightroom update time again and there's a couple of minor improvements as well as new cameras, lenses and bug fixes! See this blog post for Lightroom Classic and this blog post for the Lightroom Cloud Ecosystem changes.

calculate aspect ratio and export as keyword?

Status
Not open for further replies.
Joined
May 9, 2015
Messages
1,288
Location
Palo Alto, CA
Lightroom Experience
Power User
Lightroom Version
Classic
Lightroom Version
LrC 10.0
Operating System
  1. Windows 10
  2. macOS 10.15 Catalina
Hi,

Anyone know of a plugin that can calculate aspect ratios (as a percent) from the cropped dimensions and save the number someplace in metadata or be able to include that number on exported images as an additional keyword added during export?

Thanks -- Dan
 
Joined
Apr 3, 2012
Messages
1,678
Location
Bay Area, California, USA
Lightroom Experience
Power User
Lightroom Version
Classic
1. You could use LR/Transporter:

- Export the dimensions of selected photos into a tab-separated file.
- Edit the TSV file in a text editor and change dimensions of the form "5472 x 3648" to "5472<tab>3648".
- Import the edited TSV file into Excel or Google Sheets and add a column computing the numeric aspect ratio from the width and height columns. (You could skip the previous step by using an Excel formula to extract the width and height from the string "5472 x 3648"; don't know about Google sheets.)
- Save the TSV file as a CSV file
- Use LR/Transporter to import the CSV file, specifying that the numeric aspect ratio column "appends to" Lightroom's keywords.

LR/Transporter seems to export the original dimensions only, not the cropped dimensions. If you want to use the cropped dimensions, or if you want to export the cropped or uncropped numeric aspect ratio directly, you could use Any Filter's Sort command to export a CSV file containing the Numeric Aspect Ratio field or the Uncropped Numeric Aspect Ratio field.

2. You could use an Exiftool one-liner:

- Select all the photos in a folder tree and do Metadata > Save Metadata To File.
- Run an Exiftool command using its "advanced formatting feature" to use a Perl expression to transform the ImageSize tag to a numeric aspect ratio and then append that to the keywords of the photo. (This would use the uncropped dimensions, not the cropped dimensions.)
- Select all the photos and do Metadata > Read Metadata From File

It's been 10 years since I've written any Perl, so I wouldn't be able to help with this. (It would probably take me 2 or 3 hours to figure out the right Perl and Exiftool magic).
 
Status
Not open for further replies.
Top