Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#157 Yesterday 21:13:56
Re: Automatic thumbnails for Textpattern
Bloke wrote #341718:
One step further: the request cache is entirely removed now.
Cool! Things are moving thick and fast today. Everything works as before. 🥳
I’ve also tried out a couple of webp, avif, png, gif and svg files.
- regular webp and avif files resized without any problems. The downsizing felt a bit blurry but it was a big file, so it may have been my example file. 👍
- svg files are left as-is. 👍
- transparent webp and png files are downsized correctly. 👍
- animated webp and gif files render as static files.* 😯
- gif transparency is rendered okay for custom files (if slightly pixelated) but for automatic thumbnails, transparent gif backgrounds are rendered in black. 🥷
*Presumably, the problem with animated images is a limitation of what GD is able to downsize (I vaguely remember something about having to split an animated file into the individual images, resize then recombine). ImageMagick may be able to do it out of the box…
TXP Builders – finely-crafted code, design and txp
Offline
#158 Yesterday 21:31:04
Re: Automatic thumbnails for Textpattern
Yes, we’re stuck with GD’s limitations for animated content. At least it has a go at avif and gif. It won’t even entertain animated webp.
There’s a slight annoyance with our SVG implementation insofar as it always renders a token. That’s because there’s no thumbnail ever created; it just resizes the original.
We could do with detecting this $ext when we serve thumbnails and just bypass the token altogether since we won’t ever make thumbs from them so there’s no need to protect them.
I tried last night but ended up breaking svg support so I gave up.
Last edited by Bloke (Yesterday 21:53:48)
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
#159 Yesterday 21:42:52
Re: Automatic thumbnails for Textpattern
Bloke wrote #341720:
There’s a slight annoyance with our SVG implementation insofar as it always renders a token … We could do with detecting this
$extwhen we serve thumbnails and just bypass the token altogether.
Agree.
What do you think about the black gif background? Is that maybe a just a missing setting in GD given that the transparent background works (in rudimentary gif-form) when the thumbnail is set to custom?
TXP Builders – finely-crafted code, design and txp
Offline
#160 Yesterday 21:58:27
Re: Automatic thumbnails for Textpattern
jakob wrote #341721:
What do you think about the black gif background?
There’s a SLIR filter for background colour (not sure if it supports transparency: there’s no mention of alpha channels in their docs). Either way, it’s a weird one to offer as a tag attribute because it only applies to a few image formats, and would be ignored otherwise. I guess we could expose it and see what happens.
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