Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#85 Today 11:25:22
Re: Automatic thumbnails for Textpattern
etc wrote #341621:
Mined area. I’ve made some changes like this in 4.8.8… to discover that empty
widthis used more often than expected, so 4.9 restores (?) the 4.8.7 behaviour.
Not sure. I don’t want to trample too much old code. But if you don’t specify you want to see a thumbnail (i.e. you expect the full image because you’ve not supplied any attributes to the contrary) it’s counterintuitive to see a scaled version just because you have made a physical thumbnail… isn’t it?
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
#86 Today 11:55:02
Re: Automatic thumbnails for Textpattern
I created a bunch of tests using an Article Image field with a range and some random images of different types (10-17, 36, 34, 6):
<txp:if_article_image>
<h3>Full article image</h3><txp:article_image /><br>
<h3>Full zero width article image</h3><txp:article_image width="0" /><br>
<h3>Scaled fullsize article image</h3><txp:article_image width="400" /><br>
<h3>Article image thumbs (default)</h3><txp:article_image thumbnail range /><br>
<h3>Scaled article image thumbs (default)</h3><txp:article_image thumbnail range width="400" /><br>
<h3>Custom article image thumbs (forced)</h3><txp:article_image thumbnail="1" range /><br>
<h3>Custom scaled article image thumbs (forced)</h3><txp:article_image thumbnail="1" range width="400" /><br>
<h3>Auto scaled article image thumbs (forced)</h3><txp:article_image thumbnail="2" range width="300" /><br>
<txp:images>
<h3>Full image</h3><txp:image />
<h3>Full zero width image</h3><txp:image width="0" />
<h3>Scaled fullsize image</h3><txp:image width="300" />
<h3>Thumb (default)</h3><txp:image thumbnail />
<h3>Scaled thumb (default)</h3><txp:image thumbnail width="250" />
<h3>Custom thumb (forced)</h3><txp:image thumbnail="1" />
<h3>Custom scaled thumb (forced)</h3><txp:image thumbnail="1" width="250" />
<h3>Auto scaled thumb (forced)</h3><txp:image thumbnail="2" width="200" />
</txp:images>
</txp:if_article_image>
The results seemed fairly consistent after applying the latest patch.
Is that any more logical, do you think? And does it work for your own tests?
One little irritation: you can’t output exactly the same thumbnail image with exactly the same dimensions/crop more than once on the same page, because the second token overwrites the first and causes it to become invalid. Hence the reason I’ve varied the image sizes throughout.
This isn’t an issue if the security feature is turned off. So, dunno. Depends if we think anyone is likely to want to display the same thumbnail image at the same size multiple times on the same page. Maybe a list view (sidebar) and an individual article_custom on the same page, perhaps? Although would they employ identical sizes in real applications? Hmmm.
Last edited by Bloke (Today 11:59:30)
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