Skip to content

Sharp, Modes and Fit #386

@smockensturm

Description

@smockensturm

Question

We are using the Sharp Transform Method and the createOptimizedImages() function in a twig template. (Don't judge)

What is the best way to configure modes and fit? Am I missing something? Would be cool if we could pass that in with the variant.

Sometimes we want to 'cover' and sometimes we want to 'contain'

{
	'width': width,
	'useAspectRatio': ( height != null ) ? true : false,
	'aspectRatioX': width,
	'aspectRatioY': height,
	'retinaSizes': ['1'],
	'quality': 90,
	'format': 'jpg',
	'fit': 'contain'
}

Probably also background color. It is black at the moment. When forced to 'contain'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions