Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#229 Today 07:28:13

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

Re: Automatic thumbnails for Textpattern

phiw13 wrote #341820:

the width and height dimensions (and the equivalent <txp:image_info type='w' />, etc) are given as if in landscape mode – always 4000px by 3000px.

That’s a feature bug in the way we handle uploads. We only switch the dimensions given by the orientation info for thumbnails (custom and automatic).

You’re right: we probably should do that for the main image too. If there’s opportunity to do that check during the upload process (if jpg, and orientation flag is one of the four anomalies) then we could flip w and h values before storing in the DB for the main image too.

I won’t be able to look at this until much later today, so if anyone fancies having a stab in the meantime, please commit or propose a PR. Most of the code can be cadged from class.thumb.php.

Edit: I presume only jpg images are affected by this? How do webp, PNG and avif etc handle orientation?

Last edited by Bloke (Today 07:30:10)


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

Board footer

Powered by FluxBB