Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-02-21 05:31:20

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 596
Website

JIT Image Manipulation?

I’m sort of excited to use Symphony’s JIT Image Manipulation, and I’m wondering if there’s a way to get close with Textpattern.

After you upload an image, you can use a special HTML img src URL like this:

<img src="http://yoursite.com/image/1/200/0/images/ninja-parade.jpg"/>

…which would take the “ninja-parade.jpg” image and resize it (the ‘1’ argument) to 200px wide, keeping the correct aspect ratio (since height is set to 0 in the next argument).

So basically you can have an image resized, cropped, etc. right when you call it from your template (JIT being “Just In Time”), rather than manually creating thumbnails of all sorts.

I can see where this would make certain work a bit more idiot-proof. And hey, maybe even easier for clients to work with. And I’m wondering if it’s already been done in Textpattern. Or if it hasn’t, I’m wondering if there are similar solutions.

It just seems sort of Textpattern-y to me. :-)

Last edited by maruchan (2011-02-21 05:32:41)

Offline

#2 2011-02-21 05:55:04

Mats
Member
From: Sweden
Registered: 2011-01-16
Posts: 30
Website

Re: JIT Image Manipulation?

Check this out

Upload it to your root folder and try something like this:

<txp:if_article_image >
<txp:images limit="1" break="">
<txp:permlink>
<img src="/slir/w100-c1:1/<txp:image_url/>" alt='<txp:image_info type="alt"/>' />
</txp:permlink>
</txp:images>
</txp:if_article_image>

Offline

#3 2011-02-21 06:48:21

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 596
Website

Re: JIT Image Manipulation?

Holy crap.

I can’t wait to try that, thanks Mats!

Offline

#4 2011-02-21 07:02:48

Mats
Member
From: Sweden
Registered: 2011-01-16
Posts: 30
Website

Re: JIT Image Manipulation?

Original idea: Txp tips

Offline

Board footer

Powered by FluxBB