Canvas Resize Image To Fit. Canvas style height height px. Hit okay when your done.
Canvas style width width px. Var windowratio window innerheight window innerwidth. Select the layer with the smaller image image trim and result is below.
Var canvasratio canvas height canvas width.
Yes it is image trim. Use scaleto scale image. If windowratio canvasratio height window innerheight. In adobe after effects you have the option to automatically scale a layer to fit the composition size either horizontally or vertically.