Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 Yesterday 14:43:36

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,129
Website GitHub

Re: Automatic thumbnails for Textpattern

Wait, ignore me about the thumbnail=“3” thing. That would work for the tag generation side, but there needs to be some trigger to tell the other half of the process to “ignore the security check please.” And if our tags can do that (remember it has to be coded in the URL somehow, as that’s the only link the system has) then A.N.Other attacker can also provide the same URL param to bypass any restriction.

Extending the timeout is the most sensible option. What I think I’ll do is ditch the individual timeouts per request (which makes them render faster too) and just let THUMB_VALIDITY_SECONDS govern how often the garbage collector runs. That way, if you want the thumbs around for a week instead of 2 days, you can tweak that param in config.php.


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

#14 Yesterday 18:16:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,129
Website GitHub

Re: Automatic thumbnails for Textpattern

Okay, tweaked. That should work a bit better for everyone. Thank you for the feedback and sanity check.


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

#15 Yesterday 19:23:26

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,087
Website GitHub

Re: Automatic thumbnails for Textpattern

👍 Working nicely! Thank you so much. I’ll put it through its paces a bit in the coming days.


TXP Builders – finely-crafted code, design and txp

Online

#16 Today 00:10:23

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,192
Website Mastodon

Re: Automatic thumbnails for Textpattern

I was just in the process pf searching about for the plugin to create thumbnails on a current project using 4.9.9X. On my old 4.8.8 site i am using tom_image_grid. And i know of smd_thumbnail.
It sounds like i should just wait and use what is coming in core––which will soon arrive. Correct?


…. texted postive

Offline

#17 Today 02:08:01

giz
Plugin Author
From: New Zealand
Registered: 2004-07-26
Posts: 409
Website GitHub Twitter

Re: Automatic thumbnails for Textpattern

Love it! Its not breaking a sweat / behaving itself in my testing on a site with a few hundred ‘hi-res’ images.

Bloke wrote #341470:

Really large images can make the engine spit its dummy out and refuse to render thumbnails. You’ll just get the alt tag shown because it can run out of memory. So don’t upload 20MB super hi-res pics and expect miracles. Or, if you do, whack your php.ini settings up a lot.

I’ve found that a reasonable maximum size for image originals (i.e. works with the default settings of most hosts) is a max pixel dimension of 3000 eg. 3000px by 2000px, or 2000px by 3000px. A 3000px square original is often too much to ask, memory-wise.

Offline

#18 Today 06:11:11

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

Re: Automatic thumbnails for Textpattern

Following the latest tweaks things are working quite smoothly. I’ve updated two txp:shortcodes adapting them to the new world. and visited the pages using them, that works well so far. Lazy loading works well I think (even letting a page idle and in a background tab for like 1hour). Resizing the browser window works smoothly (all on localhost, PHP 8.5).

What was a little surprising maybe: on the dummy test install I batch uploaded some 25 images (various sizes and formats). After the upload complete the admin thumbnails did not display. After viewing the edit panel for one image caused all to appear.

Second possible surprise: I had created a page using the <txp::gallery / shortcode Jakob posted above and viewed it while only having ~5 images. After the upload above, I revisited the page (reload) largish gaps displayed where the newly uploaded images ought to. After a force reload all was well.

–^–

Some minor admin Edit > images layout tweak for the thumbnail area:

  1. a heading (h3) before the thumbnail type <label><select> block? Useful orientation for AT
  2. wrap the <label for=xxx>Thumbnail type</label> <select /> in a <p or div? -> having a container for the admin-theme design.
  3. wondering: can we get rid of the image size in the alt and title (in my case, aspect ratio is disabled, it does not provide any relevant info). I would get rid of the title attribute altogether. Same applies to the list table.

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

Offline

#19 Today 08:18:22

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,087
Website GitHub

Re: Automatic thumbnails for Textpattern

phiw13 wrote #341499:

wondering: can we get rid of the image size in the alt and title (in my case, aspect ratio is disabled, it does not provide any relevant info). I would get rid of the title attribute altogether. Same applies to the list table.

Erm, *raises hand*: if you mean the tooltip on rollover on the main image, I do actually refer to from time to time when checking on an old site what image size I used at the time for the main image. Not sure if it’s relevant for the alt text though (maybe it does help some users?).

But, I could/should probably work out another more suitable way of finding out that information.


TXP Builders – finely-crafted code, design and txp

Online

#20 Today 08:42:10

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,129
Website GitHub

Re: Automatic thumbnails for Textpattern

jakob wrote #341503:

Erm, raises hand: if you mean the tooltip on rollover on the main image, I do actually refer to from time to time when checking on an old site what image size I used at the time for the main image. Not sure if it’s relevant for the alt text though (maybe it does help some users?).

Ah okay, yeah, that might be helpful. I’ll reinstate the dimensions on the main image only. Saves having to open it to find out.

EDIT: Done

Last edited by Bloke (Today 08:47:40)


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

#21 Today 08:48:40

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,129
Website GitHub

Re: Automatic thumbnails for Textpattern

phiw13 wrote #341499:

Some minor admin Edit > images layout tweak for the thumbnail area

All done, save for the title attribute on the main image in the Edit step, as Julian noted. Thank you.


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

#22 Today 08:49:01

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

Re: Automatic thumbnails for Textpattern

jakob wrote #341503:

Erm, raises hand: if you mean the tooltip on rollover on the main image, I do actually refer to from time to time when checking on an old site what image size I used at the time for the main image. […]

Would there be some benefit of having the width and height output in side column – as plain text, similar to the ID?


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

Offline

#23 Today 08:50:46

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,087
Website GitHub

Re: Automatic thumbnails for Textpattern

phiw13 wrote #341508:

Would there be some benefit of having the width and height output in side column – as plain text, similar to the ID?

Yes, better even, or perhaps under the image?


TXP Builders – finely-crafted code, design and txp

Online

#24 Today 08:54:57

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

Re: Automatic thumbnails for Textpattern

jakob wrote #341509:

Yes, better even, or perhaps under the image?

I would keep it with the other meta-data.


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