Can’t find a way of doing this automatically.
Is there a way DT can read each picture’s aspect ratio?
I often mix up ratios during a shooting session, and it would be handy to have the choice I made reflect in the crop, rather than do en mass post import.
Adobe Bridge automatically senses the ratio and displays accordingly, so I know there must be date it’s using.
I shoot with 3:2 aspect ratio in camera, but with 5:4 frame markers.
I would like DT to automatically crop down to 5:4 on import, using the max width in portrait, and max Height in landscape - also to crop from the centre of the image.
Having difficulty doing this, as I can’t see anything in image information relating to it. Some aspect ratio metadata must be there to grab, because Lightroom automatically applies the chosen ratio as a crop on import.
Note: In my case, the Lumix S5 doesn’t have a native 5:4 crop factor, only overlayed guide markers in the viewfinder. But if it was spitting out data with the chose guide ratio, it would be great to be able to automatically add that as a crop in DARKTABLE.
I looked at the images with exiftool and exiv2 and there is nothing in the metadata about 5:4 or frame markers.
I’m guessing that information is in the Maker Notes, which is the proprietary camera information that camera makers don’t share unless you sign an NDA. So until someone reverse engineers it, I don’t think there’s much we can do as far as detecting and responding to it.
So here is what can be done. Open a landscape image in darkroom, choose the 5:4 crop and orient it and position it where you want. Save it as a preset for the crop module called landscape (or whatever). Do the same for portrait and save it as a preset named portrait.
Then with a lua script that runs when an image is opened in darkroom the appropriate script could be applied.
Or, make a style landscape with the landscape preset and a style portrait with the portrait preset and then sort by aspect ratio, select all of one orientation, apply the style, then invert the selection and apply the other style.
Essentially, you have two options: if you shoot raw+JPEG, you can read the JPEG aspect ratio. Or you can figure out where in the EXIF the crop aspect ratio is saved.
Based on that, you can use a Lua script to select an appropriate crop for your raw on import.
How about figuring out the aspect ratio from the embedded JPG preview? It’s a hack, but may be easier to do than deciphering the Makernotes. (Edit: sorry about the typos)