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
#161 Today 08:54:14
Re: Automatic thumbnails for Textpattern
Things continue to work well after the latest tweeks. Happy to see those perf. improvements and those cleaner thumbnail image URL’s
Bloke wrote #341711:
It’s meant to currently return the size of the custom thumb from the database. Since the widths of the auto thumbs aren’t stored anywhere, we don’t necessarily know what width they are.
Thank you for confirming, I suspected as much. <txp:image_info type="thumb_w" /> is then only useful for custom thumbnails, for which I still have a few use cases.
jakob wrote #341719:
[…]
- transparent webp and png files are downsized correctly. 👍
Really? My experience is a little different. Automatically generated thumbs for UI screenshots show a black border around the image – the transparent area. Oddly choosing custom thumbnail and let the system generate the image works surprising well, blurry but transparent and no odd border.
Think about images like here: l-c-n.com/stuff/sandspace-a-theme-for-the-textpattern-cms-admin-interface. If you want to try, here is the equivalent .webp image which will be in use soon. Try using <picture srcset="<txp:image_url thumbnail width="800" …> (half the size).
( I will continue using Acorn generated scaled down images for my screenshots!)
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline