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,288
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,591
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

Board footer

Powered by FluxBB