Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 Today 01:27:33

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

Re: Feedback: Textpattern CMS 4.9.0 released

phiw13 wrote #341923:

On a default install, with the default theme you upload an image, a thumbnail is created automatically but it has the same size as the full sized image.

Urk, it’s meant to use the fallback sizes (200×200) but I probably didn’t test that enough, since my installation always had the Admin Theme prefs in place, which masked the fallbacks.

I did try uploading a new image on the site I’ve just updated to 4.9.0 and the thumbnail came out at 200×200, but I haven’t checked what happens on a brand new installation.

If it’s misbehaving, we’ll fix it.

EDIT: P.S. Does your new install include the images/thumb dir? If that’s missing, you’ll get full size thumbs created

Last edited by Bloke (Today 01:29:06)


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

#26 Today 02:53:08

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

Re: Feedback: Textpattern CMS 4.9.0 released

Bloke wrote #341929:

If it’s misbehaving, we’ll fix it.

EDIT: P.S. Does your new install include the images/thumb dir? If that’s missing, you’ll get full size thumbs created

My new installation, localhost with PHP 8.5, does not have a thumb dir in /images/. Inserting an image in the article (<txp:image thumbnail id="2" width="600" />) fails to show the image.

I see more problems. With theme Sandspace and the prefs.json active. Thumbnails are generated on the admin side. On the public side not well at all ;-(. Thumbnails are generated at a variety of sizes (they all should be equal), a smaller than expected thumb is used (screengrab localhost: dev.l-c-n.com/_b/txp-thumbs_issue.png),

Code like this does not render the images correctly:

<txp:images id='<txp:custom_field name="article_image" />' sort='rand() asc' wraptag='' break='' limit='16'>

<figure itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
  <a href="<txp:image_url />" class="image-gallery-link image-lightbox" data-caption="<txp:image_info escape='textile, p' />">
  <picture><!-- order: .avif / .webp / .jpg or .png -->
  <source srcset="<txp:image_url thumbnail width="160" /> 160w, <txp:image_url thumbnail width="200"  /> 200w, <txp:image_url thumbnail width="260" /> 260w, <txp:image_url thumbnail width="460" /> 460w" sizes="(min-width: 1300px) 225px, (min-width: 1120px) calc(20vw - 31px), (min-width: 920px) 225px, (min-width: 740px) calc(21.25vw + 34px), (min-width: 580px) 225px, calc(41.54vw - 8px)" type="image/webp">
  <img loading="lazy" src="<txp:image_url />"  alt="<txp:image_info type='alt' />" height="<txp:evaluate query='ceiling(<txp:image_info type="h" />* 0.5)' />" width="<txp:evaluate query='ceiling(<txp:image_info type="w" />* 0.5)' />">
  </picture>
  <meta itemprop="width" content="<txp:image_info type="w" />"><meta itemprop="height" content="<txp:image_info type="h" />">
  </a>
<figcaption itemprop="caption"><txp:image_info escape="textile, p" /> </figcaption>

</figure>
</txp:images>

The browser source shows (token shortened, line breaks added):

srcset="https://l-c-n.com/images/thumb/w160-h224-q60/20.webp?token=c548 160w, 
https://l-c-n.com/images/thumb/w210-h224-q60/20.webp?token=6d2090 210w, 
https://l-c-n.com/images/thumb/w260-h224-q60/20.webp?token=ae1cc4bb3 260w, 
https://l-c-n.com/images/thumb/w460-h224-q60/20.webp 460w"

For each thumb , notice the h-224. All equal (they should not)

If I manually add the height to each thumb in the srcset: <txp:image_url thumbnail width="160" height="239"/> 160w, and so on,, each thumb its own height, at least each image is rendered the same size, but too small (view here: l-c-n.com/postcards/). The server uses PHP 8.4.15. with Textpattern release. Localhost with PHP 8.5.1 does exactly the same. But first I need to step away from the computer for a moment.

That was working correctly yesterday afternoon when I last tested. Maybe this changeset broke it all. I am going to see if I can revert that.


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

Offline

#27 Today 05:06:55

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

Re: Feedback: Textpattern CMS 4.9.0 released

I’m seeing this too. It’s now requesting multiple height values from SLIR, so where previously I had the following folders:

w400-c4x3
w800-c3x3
w1200-c2x3

it’s now creating the following folders:

w400-h600-c4x3
w400-h4032-c4x3
w400-h8064-c4x3
w800-h600-c3x3
w800-h4032-c3x3
w800-h8064-c3x3
w1200-h600-c2x3
w1200-h4032-c2x3
w1200-h8064-c2x3

Philippe’s diagnosis seems right. Reverting to the previous state restores prior functionality.


TXP Builders – finely-crafted code, design and txp

Offline

#28 Today 06:12:57

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

Re: Feedback: Textpattern CMS 4.9.0 released

Nuts. Making valueless heights seemed to be working in my tests. So it seems to be always adding heights now when they’re not wanted. That’s a drag, sorry. Does height="0" silence it as a workaround?

Will issue a patch/reversion that you can all test properly first.


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

#29 Today 06:35:41

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

Re: Feedback: Textpattern CMS 4.9.0 released

A single image code:

<txp:image thumbnail id="169" width="600"  quality="100" crop="4x3" alt="a tree in green" />

The intrinsic image dimensions are 1500×2000. The resulting browser code:

<img src="http://e-t13.test/images/thumb/w600-h2000-c4x3-q100/169.webp?token=5e25cb544df98e241cf13f4e7e8b199a6242a51ff329dd3493403d3286c8cc41" alt="a tree in green" width="600" height="2000">

The stylesheet has img { width: auto; height: auto; }, without that the image would look rather stretched…


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

Offline

#30 Today 06:41:46

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

Re: Feedback: Textpattern CMS 4.9.0 released

The CSS on my test site must have been overriding the HTML. That is indeed annoying.

Does height="0" shut it off, albeit temporarily?


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

#31 Today 06:43:38

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

Re: Feedback: Textpattern CMS 4.9.0 released

Bloke wrote #341935:

Does height="0" shut it off, albeit temporarily?

Yes.


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

Offline

#32 Today 06:52:33

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

Re: Feedback: Textpattern CMS 4.9.0 released

Phew. So at least there’s a workaround. That’s similar to 4.8.8 then, which is kinda good in terms of consistency (less boat rocking for existing tags) but more verbose than I would like.

There has to be some middle ground approach somehow which satisfies both goals of allowing valueless widths and heights to output the stored image dimensions, but ignore the stored information if the attribute is not provided.

Ideas welcome.


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

#33 Today 07:21:55

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

Re: Feedback: Textpattern CMS 4.9.0 released

I reverted the above mentioned changeset does fix the problem with that more complex srcset above. The single image code:

  • with valueless height: no image displayed, html height has the intrinsic height (DB value)
  • without the height: no html height attribute added.
  • height=‘0’: no height attribute added.

(daydreaming) Me would love to see a magic solution were the width and height attributes reflect the dimensions of the thumbnail actually used.I thought theguardian.com did that but that does not appear to be the case


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