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

[Canary] Images are enlarged when sizes includes a larger size #198

Open
Nick-Mazuk opened this issue Aug 29, 2020 · 0 comments
Open

[Canary] Images are enlarged when sizes includes a larger size #198

Nick-Mazuk opened this issue Aug 29, 2020 · 0 comments

Comments

@Nick-Mazuk
Copy link

First of all, thanks for such an awesome plugin!

Second, when there's a size listed that's larger than the original image size, the plugin seems to create a larger image. This is not ideal because enlargening an image doesn't provide more detail and just increases the file size.

For instance, if you use the profile picture from the Next JS tutorial (which is 400x400) and use these size settings, it will create a version that's 2200x2200! The original file was 62 kB, and the file served is 64 kB (if supporting retina displays, it's 156 kB).

<Img src={require('profile.jpg')} sizes={[200, 700, 1500, 2200]} />

The same issue occurs when using an image.config.js file, which is perhaps more important since you don't know the original images file size when creating the settings.

Ideally, only smaller versions are created.

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

No branches or pull requests

1 participant