Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-03-17 18:02:36

eheil
Member
Registered: 2008-03-17
Posts: 11

Built-in thumbnailing is awesome EXCEPT for aspect ratio...

I’m just learning txp, so apologies if this is an answered question, but I couldn’t find it in a casual search of the archives…

The built-in thumbnailing in txp is great — but I wish I could tell it to keep the aspect ratio and resize the longest side (or the height, or the width, or whatever) to a desired size, not resize to an exact height and width.

I see the glx_admin_image will let me do that, but it doesn’t appear on the upload screen, just the “edit image” screen, so to use it after uploading an image I’ve got to save the image and then reopen it for editing, which is kind of a drag.

My php-fu is weak, but peeking at the code it seems as if the wet_thumb class has the capability to do this; it’s just not being exploited by its heir, the txp_thumb class. Unless there’s a way to do it I’m not seeing.

Any ideas on an easy-on-the-workflow way to achieve thumbnail creation with the aspect ratio preserved?

Thanks!

Offline

#2 2008-03-17 19:22:30

eheil
Member
Registered: 2008-03-17
Posts: 11

Re: Built-in thumbnailing is awesome EXCEPT for aspect ratio...

Answered my own question:

Put a 200 (for example) for height, and a 0 for width, and click the “crop” box…

Sizes the image to 200 pixels height and keeps the aspect ratio. Wicked!

Offline

#3 2008-03-17 20:00:11

masa
Member
From: North Wales, UK
Registered: 2005-11-25
Posts: 1,095

Re: Built-in thumbnailing is awesome EXCEPT for aspect ratio...

You might also want to check out ebl_upload
It can upload multiple images in one go, create thumbs and resize the large images to a size you specify. It also allows you to create and assign a new category to the images.

It’s not free, but well worth its tiny price tag!

Offline

#4 2008-03-17 20:03:18

eheil
Member
Registered: 2008-03-17
Posts: 11

Re: Built-in thumbnailing is awesome EXCEPT for aspect ratio...

That looks good! Right now I’m just experimenting, but if I put something stable/permanent together it looks like a very good deal.

Offline

#5 2008-03-17 20:37:41

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Built-in thumbnailing is awesome EXCEPT for aspect ratio...

eheil wrote:

Put a 200 (for example) for height, and a 0 for width, and click the “crop” box…
Sizes the image to 200 pixels height and keeps the aspect ratio. Wicked!

You can also enter height or width, leave the other one empty, don’t check ‘crop’, and it will give you the same result :)

Offline

#6 2008-03-17 20:40:41

eheil
Member
Registered: 2008-03-17
Posts: 11

Re: Built-in thumbnailing is awesome EXCEPT for aspect ratio...

You know, it didn’t seem to work that way for me… I had tried that and it didn’t seem to do anything… but in retrospect, I probably just had the old thumbnails cached in my browser!… I must have happened to check “crop” or something at the same time that I happened to upload a new image, which got a new thumbnail, which not being cached looked the way I wanted it to do… convincing me that “crop” somehow had something to do with it. Thanks for pointing out that’s not true. :)

Offline

Board footer

Powered by FluxBB