Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#145 Today 11:11:19
Re: Automatic thumbnails for Textpattern
jakob wrote #341705:
my understanding is that you will not need to change your site when upgrading, unless you decide to switch to using automatic thumbnails.
100% accurate post. Thanks for the clarification.
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
#146 Today 11:15:52
Re: Automatic thumbnails for Textpattern
Same experience as Julian above with loading images etc. First load: a token for the requested image. After a reload or visit with a different browser, and inserted in another article: no more token (assuming the same sizes are requested; I tested will all 3browser at same viewport size).
For that height problem: it something that has long annoyed, me. I mostly / always use to <txp:images> with <img src="txp:image_url width=txp:image_info type=w"> constructions
–^–
Handling of tokens (I assume the below items make use of the updated extpattern/vendors/Textpattern/Security/Token.php):
- the admin side backend
noncegeneration works fine (for CSP), as doessmd_token. - com_connect: the form
IDis generated, the form can be submitted, but I do not know if it gets any further, no mail server on localhost
–^–
Q: What is the expected output of <txp:image_info type="thumb_w" /> ? At the moment I always see 200.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
#147 Today 11:43:41
Re: Automatic thumbnails for Textpattern
jakob wrote #341704:
The 3rd and 5th variants get it right, the others steadfastly output 300 regardless of whether the original image or the downsized thumbnail.
I think there was a typo concerning the 1st variant, should work now.
Great performance improvements otherwise over the initial SLIR integration!
Offline
#148 Today 11:46:42
Re: Automatic thumbnails for Textpattern
etc wrote #341709:
I think there was a typo concerning the 1st variant, should work now.
D’oh. Sorry. Good catch. I renamed the variable and missed one instance.
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
#149 Today 11:50:57
Re: Automatic thumbnails for Textpattern
phiw13 wrote #341708:
What is the expected output of
<txp:image_info type="thumb_w" />?
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.
Oleg: is it possible to fudge the dimensions on the fly inside <txp:images> or when loading a thumbnail with a name/id and specifying your own dimensions? Or do we just leave this as a quirk?
I’m away from the laptop most of the day so I can’t investigate.
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
#150 Today 12:13:09
Re: Automatic thumbnails for Textpattern
Bloke wrote #341710:
D’oh. Sorry. Good catch. I renamed the variable and missed one instance.
Thank you.
Rather thanks to all testers, please keep testing.
Oleg: is it possible to fudge the dimensions on the fly inside
<txp:images>or when loading a thumbnail with a name/id and specifying your own dimensions? Or do we just leave this as a quirk?
1) sure; 2) good question. Are there real-life situations when you need to change only one dimension? Should we also somehow take crop into account?
Offline
#151 Today 13:25:55
Re: Automatic thumbnails for Textpattern
etc wrote #341712:
Are there real-life situations when you need to change only one dimension?
Probably not. I’m inclined to think our original implementation on 4.earlier was wrong.
Should we also somehow take
cropinto account?
If we can, I guess. Not sure how.
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
#152 Today 13:57:49
Re: Automatic thumbnails for Textpattern
etc wrote #341709:
I think there was a typo concerning the 1st variant, should work now.
That was it. I now get the following for a custom image with original dimensions 3857×2571 and a custom thumbnail of size 450×300:
<!-- <txp:article_image /> -->
<img src="http://thumbnail.test/images/13.jpg" alt="…" width="3857" height="2571">
<!-- <txp:article_image width="200" /> -->
<img src="http://thumbnail.test/images/13.jpg" alt="…" width="200" height="2571">
<!-- <txp:article_image thumbnail width="200" /> -->
<img src="http://thumbnail.test/images/13t.jpg" alt="…" width="200">
<!-- <txp:article_image thumbnail="1" width="200" /> -->
<img src="http://thumbnail.test/images/13t.jpg" alt="…" width="200">
<!-- <txp:article_image thumbnail="2" width="200" /> -->
<img src="http://thumbnail.test/images/thumb/cache/rendered/w200/13.jpg" alt="" width="200">
and for an automatically-generated thumbnail:
<!-- <txp:article_image /> -->
<img src="http://thumbnail.test/images/1.jpg" alt="…">
<!-- <txp:article_image width="200" /> -->
<img src="http://thumbnail.test/images/1.jpg" alt="…" width="200">
<!-- <txp:article_image thumbnail width="200" /> -->
<img src="http://thumbnail.test/images/thumb/cache/rendered/w200/1.jpg" alt="…" width="200">
<!-- <txp:article_image thumbnail="1" width="200" /> -->
<img src="http://thumbnail.test/images/1t.jpg" alt="…" width="200">
<!-- <txp:article_image thumbnail="2" width="200" /> -->
<img src="http://thumbnail.test/images/thumb/cache/rendered/w200/1.jpg" alt="" width="200">
(where the 1t.jpg doesn’t load because it doesn’t exist for auto-thumbnails)
so the behaviour is ever so slightly different between the two with respect to whether the height attribute is shown.
TXP Builders – finely-crafted code, design and txp
Offline
#153 Today 16:21:35
Re: Automatic thumbnails for Textpattern
Okay, /cache/rendered subdirectory is no more. Cached thumbnail subdirs should now be directly under the ‘thumb’ directory. Please test.
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
#154 Today 16:47:25
Re: Automatic thumbnails for Textpattern
So far that seems perfect :-)
TXP Builders – finely-crafted code, design and txp
Offline
#155 Today 16:57:35
Re: Automatic thumbnails for Textpattern
Bloke wrote #341713:
(re crop) If we can, I guess. Not sure how.
Me neither. Is exposing crop in tags useful at all? In my tests, crop="2x1" crops the image in the middle, which is natural, but a bit restrictive. Would not css suffice here?
Amazingly, one of my automatic thumbnails is always rotated, whatever I try. Can live with it, if it is only me.
Offline
#156 Today 17:14:23
Re: Automatic thumbnails for Textpattern
One step further: the request cache is entirely removed now.
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