With ImageCache's default built-in actions I failed to achieve a "Zoom to fill" action, as known from the video player realm. Luckily I came to ImageCache Actions, which has a certain action called "Aspect switcher", a landscape/portrait aspect ratio dependent switch, which eventually let me achieve it!

First action set attempt FAILED:

"landscape"
1) Scale: height 300
2) Crop: width 400 height 100% xOffset center yOffset center

"portrait"
1) Scale: width 400
2) Crop: width 100% height 300 xOffset center yOffset center

"400x300-fill"
1) Aspect switcher: if portrait use portrait, if landscape use landscape

Second action set attempt WORKED:

"height300"
1) Scale: height 300

"width400"
1) Scale: width 400

"400x300"
1) Aspect switcher: if portrait use width400, if landscape use height300
2) Crop: width 400 height 300 xOffset center yOffset center

Conclusion / Possible bug ?

"Aspect switcher" seems to fail if one of its switcher included presets, contains more than one action.

Workaround:

Put only 1 action into a landscape/portrait preset. Then integrate these presets through an "Aspect switcher" action at the beginning of your preset, and all further actions below in that preset.

Comments

drinkdecaf’s picture

Thank you!

dman’s picture

Clever fix

fietserwin’s picture

@dman: something we need to do yet?

dman’s picture

Status: Needs review » Closed (works as designed)

Nothing to do - it's just an interesting recipe. Closing.