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

Optimized images are bigger than original #17

Open
Cretezy opened this issue Jun 12, 2023 · 0 comments
Open

Optimized images are bigger than original #17

Cretezy opened this issue Jun 12, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Cretezy
Copy link
Contributor

Cretezy commented Jun 12, 2023

I'm working on #11, which allows to not resize the image. This is the same as using a large width/height and setting withoutEnlargement.

Config:

  "image-optimizer": {
    enabled: true,
    config: {
      include: ["jpeg", "jpg", "png"],
      formats: ["original", "webp", "avif"],
      sizes: [
        {
          name: "original",
        },
        // Equivalent to
        {
          name: "sm",
          width: 10000,
          withoutEnlargement: true,
        },
      ],
    },
  },

Here is my original image: https://assets.csnades.gg/csnades/FILE_3_2e3706d010.png (210kb)

Here is the "optimized" version: https://assets.csnades.gg/csnades/original_FILE_3_2e3706d010.png (292kb)

Quality is set at 80 (default), however the optimized version is bigger than the original.

Additionally, the webp/avif is the same size:

image

If I download the optimized versions, they are all AVIF somehow. Seems like a bug.


Also, I'm not sure if this is related, but any optimized image doesn't work in Firefox (works in Chrome):
image

@marlokessler marlokessler added the bug Something isn't working label Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants