Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#286 2026-02-09 07:10:35
Re: Automatic thumbnails for Textpattern
Bloke wrote #342342:
Since we can’t really have 4.9.1 solely with bug fixes and minor changes, how about one feature I didn’t have time to squeeze into 4.9.0? The ability to alter the output format of automatic thumbnails.
[…]
Out of curiosity, I played a little with this. As far as I can tell, it works as advertised, a .jpg is converted to an .avif file. Resulting file is cached and when opening in another browser, the image is I think fetched as the expected type from disk when the page is fetched by another browser without delay ( I see 200 status).
Surprising and a maybe borderline confusing:
- (as mentioned) the file extension displayed when view as standalone image is the original. Firefox gives the (generated) file type in the tab title. Brave (Chromium) and Safari only display file name and size. Not much file type info to get from that.
- (and as mentioned) on the server file-system the image is stored with the original extension.
- when saving the image locally,
- Firefox saves the image with the generated extension (
.avif) - Both Brave and Safari save the file with the original extension (
.jpg). The local file system (Finder) “sees” aJPEGimage. The info box in Preview.app reflects the avif file type. Acorn opens the file according to the extension (as jpg, thus).
- Firefox saves the image with the generated extension (
Test page: emps.l-c-n.com/playground/experiment-converting-an-image-on-the-fly. The large size thumbnail should be cached on the server. Page is up for a week or so.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
#287 Today 09:06:42
Re: Automatic thumbnails for Textpattern
phiw13 wrote #342568:
the file extension displayed when view as standalone image is the original… Firefox saves the image with the generated extension (
.avif). Both Brave and Safari save the file with the original extension (.jpg). The local file system (Finder) “sees” aJPEGimage. The info box in Preview.app reflects the avif file type. Acorn opens the file according to the extension (as jpg, thus).
That’s a drag, and I suspected it would have some of those side-effects. Thank you so much for testing.
I’m not entirely sure what we can do about it. Since the image is generated on the fly, the filename is derived from what we know about the original image (what is in the txp_image ext column). That governs the type of image it expects the system to have available. If you subsequently “override” that with a tag, we need to alter the expected flename. That’s messy, but I’ll see what I can do.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline