Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 Yesterday 06:13:50

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,428
Website

generated thumbnail images compression level with .webp images

I am always rather unhappily surprised with the size of the generated thumbnails when using .webp images – on average 30% larger than it should be. This happens both with the Textpattern generated thumbnails and those generated with the smd_thumbnail plugin.

I tried to find if Textpattern or the plugin somewhere set the compression level by I got nowhere. Is there a way to improve that.

(recent versions of PHP, Textpattern 4.9dev, GD in use)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

#2 Yesterday 09:16:34

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,840
Website GitHub

Re: generated thumbnail images compression level with .webp images

Leave this with me.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 Yesterday 10:38:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,840
Website GitHub

Re: generated thumbnail images compression level with .webp images

This commit introduces the overridable TEXTPATTERN_THUMB_QUALITY constant. Add something like the following to your config.php:

define('TEXTPATTERN_THUMB_QUALITY', 60);

to lower the quality from its default value of 80 percent. The quality value is applied to JPG, WEBP and AVIF thumbnails.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 Yesterday 11:37:19

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,428
Website

Re: generated thumbnail images compression level with .webp images

Interesting, will check it out tomorrow.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

Board footer

Powered by FluxBB