Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Image resizing makes files larger

  • #6425
    Avatar photo[anonymous]

    Publii: v.0.38.3 (build 14238)

    Ubuntu 20.04

    Featured image on this page is( https://masonbee.nz/media/posts/612/responsive/Fedora-34-screenshot-2xl.png) is 958.7kB. I thought I had made a mistake so I ran it through tinypng and downsized it to 253.7 kB then removed the original featured image and used the tinypng one. But when I preview the image it is back to 958.7kB….I have cleared my cache but I think it might be a bug. The original image had been resized to 1024×758 so it wasn’t 958.7kB to start with. It appears publii is making the filesize bigger? Should I only use jpg?

    #6428
    Avatar photo[anonymous]

    I have since changed the image format to jpg and it works fine. Additionally, looking back I have other images in png format which appear to have been resized without a problem. The image in question was done on Fedora 34 so it is possible there was a problem with a dependency. The argument against that would be that I recreated the issue under Ubuntu 20.04.

    #6436
    Avatar photo[anonymous]

    I had similar experiences. It seems whatever compression they use is fast but not as good as TinyPNG or pinga.

    This is a workaround, not a fix, but it works:

    • Upload your image and let Publii resize it.
    • Find your resized files (e.g. `C:\Users\whatever\Documents\Publii\sites\whatever\input\media\posts\1\responsive` )
    • Optimize those resized files instead of the original.

    As long as you don’t upload a new image, Publii won’t regenerate the responsive ones.