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

Transform Images plugin should avoid upsizing images have smaller size than the resize options. #530

Closed
ngdangtu-vn opened this issue Dec 16, 2023 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@ngdangtu-vn
Copy link
Contributor

Version

2.0.1

Platform

Linux/Deno

What steps will reproduce the bug?

  1. add an image worth 800 × 800
  2. add another image worth 1280 × 1280
  3. add resize like below:
    export default {
      transformImages: [
        {
          // origin
          format: 'webp',
        },
        {
          format: 'webp',
          resize: [300],
          suffix: '-xs',
        },
        {
          format: 'webp',
          resize: [900],
          suffix: '-xl',
        },
      ]
    }
  4. run build script

How often does it reproduce? Is there a required condition?

always

What is the expected behavior?

The 800 resolution image should not be upsize to 900.

What do you see instead?

The 800 resolution image got upsize to 900.

Additional information

I believe if we can ignore upsizing the image with smaller size can speed up the process. Moreover, there is no point to use a upsized images in web. And in case of sb really need it, we can add it as an optional feature.

@ngdangtu-vn ngdangtu-vn added the bug Something isn't working label Dec 16, 2023
@ngdangtu-vn
Copy link
Contributor Author

I think I put wrong label, maybe it should be enhancement :?

@oscarotero oscarotero added enhancement New feature or request and removed bug Something isn't working labels Dec 17, 2023
@oscarotero oscarotero added this to the 2.1.0 milestone Dec 17, 2023
@oscarotero
Copy link
Member

Hi. Thanks!
I think this was discused somewhere and thought it was fixed with Sharp.
Will include in in Lume 2.1.0

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

No branches or pull requests

2 participants