Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharp, Modes and Fit #386

Open
smockensturm opened this issue Jun 22, 2023 · 0 comments
Open

Sharp, Modes and Fit #386

smockensturm opened this issue Jun 22, 2023 · 0 comments
Labels

Comments

@smockensturm
Copy link
Contributor

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'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant