Image Triggers - any advice on determining Orientation and Aspect Ratios?


(Douglas (@finnatic at @waikato)) #1

I'm working on various functionality looking at simplifying image uploading alongside other work.

 

One thing I've pondered is whether an image resizing trigger can be constructed that either determines an image orientation (e.g. portrait or landscape) or the aspect ratio (e.g. 4:3) and then acts as desired.

 

Has anyone ever tried to do something along these lines where they've managed something purely in Matrix?  Or a JavaScript solution?


(Joel Porgand) #2

I don't think you'd be able to do that with triggers at present. There are apparently plans to improve varieties/triggers though - https://squizmap.squiz.net/matrix/6021

 

If you want to get fancy you can probably build yourself a tool with the REST JS asset and something like this - https://www.npmjs.com/package/jimp


(Douglas (@finnatic at @waikato)) #3

Thanks J.P.  Those planned improvements do look like they'd offer many (if not all) the opportunities I'm thinking of.