Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Feedback: Textpattern CMS 4.9.0 released
phiw13 wrote #342109:
valueless
widthandheight, it is not very intuitive.
True. But now, since it defaults to the more sensible least permissive output by default, it’s handy to have a way to say “use the native sizes please” if you really, really want them in the tags for placeholder / space reservation reasons.
Valueless attributes seemed sort of natural for this application, and saves having to manually look up or set the dimensions by hand for each image. You can just add width / height to your tag and it’ll output the right sizes, even if you switch to using a (custom) thumbnail.
I’m still thinking about ditching the public-side access to the config.php thumb size variables, but maybe the crop should remain. Or maybe hard-code it to 1×1 if you don’t specify a value yourself.
That seems a little small. 200px, or same values as you added to theme Hive, seems more appropriate.
200 it is.
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
Re: Feedback: Textpattern CMS 4.9.0 released
Incidentally, the database sizes will also be triggered if width='' or height=''. They mean the same as valueless BUT that has an interesting ramification:
<txp:article_image thumbnail width='<txp:variable name="my_width" />' />
will behave like this:
1. if my_width has a positive value, the thumb will be displayed at the designated size.
2. if my_width returns nothing, the thumb will be displayed at the database width value (either full size, or thumb size if it’s a custom thumbnail).
3. if my_width returns “0” the width attribute will not appear in the markup and you’ll get the image displayed at native resolution.
The upshot is, if you’re doing this kind of variable-in-attribute thing, ensure you test if the variable exists and has a value before plugging it into an (article_)image or thumbnail tag to avoid any surprises.
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
Re: Feedback: Textpattern CMS 4.9.0 released
I’ve tweaked the article_image tag output now so that empty image paths are silently skipped.
Also removed references to the config.php variables in the tags so if you specify a valueless crop, you will always get 1×1 square.
Happy to alter this if anyone can think of a better solution.
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
#88 Today 03:11:14
Re: Feedback: Textpattern CMS 4.9.0 released
One test failure with a transparent .webp image: cropping. This currently fails, the image has a black background.
<txp:images id="79">
<img src="<txp:image_url thumbnail height="600" crop="9x16" />" alt="3 coloured circles, cropped" height="600">
</txp:images>
PHP 8.5, Textpattern dev. Test image: dev.l-c-n.com/_b/3circles-F.webp
This could be annoying for admin site thumbnails if the admin theme crops the image (e.g. Hive)
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
#89 Today 07:41:51
Re: Feedback: Textpattern CMS 4.9.0 released
Yeah I had a go at trying to debug that black background thing the other day and ended up scratching my head.
The purported fix has been incorporated into our code but it’s still serving black backgrounds on some (not all?!) transparent files.
At this point I have no idea why. If anyone has any clues or knows the GD library better, please throw some pointers my way.
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