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

Allow to specify width AND height #134

Closed
mahnunchik opened this issue Dec 17, 2021 · 3 comments
Closed

Allow to specify width AND height #134

mahnunchik opened this issue Dec 17, 2021 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@mahnunchik
Copy link

Allow to specify width AND height to resize and crop to specific dimensions.

const metadata = await Image(src, {
  sizes: [{ width: 300, height: 200 }, { width: 600, height: 400} ],
  formats: ["avif", "jpeg"]
});

As on option the same result may be obtained by specifying aspect ratio.

@mahnunchik
Copy link
Author

Related: #31

@AleksandrHovhannisyan
Copy link
Contributor

(Might be worth just posting this code in #31 as a suggested API so we only have one ticket for it)

@zachleat
Copy link
Member

Yeah let’s organize over at #31 for this. I do like your sample code!

@zachleat zachleat added the duplicate This issue or pull request already exists label Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants