Skip to content

Add "letterbox" image transform mode #8848

Closed Answered by brandonkelly
piotrpog asked this question in Ideas
Discussion options

You must be logged in to vote

We’ve just added a new “Letterbox” transform mode for Craft 4.4 🎉 (via #12214)

Unlike Fill transforms, Letterbox transforms will always generate images with the exact width and height specified by the transform. The surrounding pixels can either be transparent or a certain color fill.

You can define Letterbox transforms in your templates by setting mode to 'letterbox':

{% do asset.setTransform({
  mode: 'letterbox',
  width: 200,
  height: 200,
  position: 'top-center',
  fill: '#000000',
}) %}

We’ve also added a new “Allow Upscaling” setting to all transforms, which takes precedence over the upscaleImages config setting when specified. (Template-defined transforms can set this via an up…

Replies: 3 comments 10 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@brandonkelly
Comment options

@CMeldgaard
Comment options

@brandonkelly
Comment options

@piotrpog
Comment options

@brandonkelly
Comment options

Comment options

You must be logged in to vote
4 replies
@brandonkelly
Comment options

@volodymyr-bihus
Comment options

@brandonkelly
Comment options

@volodymyr-bihus
Comment options

Answer selected by brandonkelly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
enhancement improvements to existing features assets 📁 features related to asset management
5 participants
Converted from issue

This discussion was converted from issue #6245 on June 22, 2021 06:27.