Skip to main content
Participant
March 30, 2022
Question

Export photos with a fixed aspect ratio

  • March 30, 2022
  • 2 replies
  • 280 views

Hello everyone,

 

I am trying to include a change in the aspect ratio as part of a plugin added to the "Export n Files" dialog.

I have just read some threads about this but still not sure if it is possible to just set the aspect ratio by setting the "Aspect" throught LrDevelopController.

I have read this discussion and this, but I was wondering if it is possible to be done avoiding the calculations of CropLeft, CropRight, CropTop, CropBottom and CropAngle and do it similar to the way it is done via LR (Develop module -> Crop -> Aspect --> Enter Custom).

Thank you in advance!

This topic has been closed for replies.

2 replies

johnrellis
Legend
April 3, 2022

"if it is possible to just set the aspect ratio by setting the "Aspect" throught LrDevelopController. I have read this discussion and this, but I was wondering if it is possible to be done avoiding the calculations of CropLeft, CropRight, CropTop, CropBottom and CropAngle and do it similar to the way it is done via LR (Develop module -> Crop -> Aspect --> Enter Custom)."

 

No, there is no documented way for a plugin to directly set the aspect ratio as you can in the UI. (I think at least one MIDI controller has found a way to do it, but it must be undocumented.)

 

Your plugin could invoke the open-source ImageMagick as a post-processing step to crop the exported photos.

 

Alternatively, if your end goal is to batch-crop large numbers of photos, you could use my Any Crop plugin. Its Batch command will apply a crop preset to a batch of photos, creating virtual copies in a collection.

johnrellis
Legend
April 3, 2022

Moderators, @Rikk Flohr: Photography, please add the SDK tag to this thread.

Community Expert
March 30, 2022

I can't answer your question so far as a plugin, but just in case it's useful, there is another way to output images to JPG. That lets you impose an on-the-fly aspect-ratio "override" without altering each image's current crop. Simply put: use Print module, borderless layout (or with border if you want, of course), setting the image's containing cell to Zoom to Fill (default is Zoom to Fit) and setting JPG as the output format.

 

Orientation, individualised file naming, individualised image metadata are the main downsides I have encountered with this method as opposed to Exporting. If the output is with printing in mind, those things won't matter.

 

Another entirely different method would be to export, but in the course of doing so, impose a further postprocessing crop onto the output - calling ImageMagick, or a PS action droplet, or whatever.