Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[request] Thumbnails on the fly
Is there any plugin that can create different size thumbs from images (JPEG, PNG, GIF…)?
Like this script http://phpthumb.sourceforge.net/
I need it for a magazine styled layout. Small thumbnails with the article excerpt on front page and bigger thumbnails in the article page, both created from the same image. I know there is a similar plugin for wordpress, but I was not able to find anything for txp.
Offline
#2 2008-07-17 15:43:13
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: [request] Thumbnails on the fly
There is some plugin called something like dynamic image, but I can’t recall at the moment.
I usually just create thumbs at the largest size I’m going to use and then scale them down via CSS where smaller ones are needed – works pretty well.
Offline
Re: [request] Thumbnails on the fly
Offline
Re: [request] Thumbnails on the fly
Thanks, I’ll check it. Also, Masa’s simple method was my first idea but I do not know how to scale down via CSS. Will see what fits better.
Offline
#5 2008-07-18 16:36:49
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: [request] Thumbnails on the fly
Thanks Tom, that’s the one.
As to scaling via CSS, this is an example of what I use:
.imagebox {
margin-right: 10px;
margin-bottom: 10px;
width: 70px;
height: 70px;
float: left;
overflow: hidden;
}
.imagebox img {
height: 100%;
}
My standard tumb size is 110px square, which I use for thumbs in article listings. In galleries however I scale them down to fit in a box 70px square. That’s what the rule .imagebox img
does. I also specify overflow: hidden
in case someone accidentally creates a thumb that isn’t square but landscape format, effectively cropping the image.
Offline
Re: [request] Thumbnails on the fly
I can’t remember exactly why right now (Safari issue I think) – there’s some reason to add
height: auto;
somewhere.
I know that’s a pretty friggin vague thing to say. – thought it might help if you are working on this now.
I’ll look at one of my stylesheets and get back in more detail.
Just be sure to keep checking Safari – I think it’s the only one with this particular issue.
Offline
Re: [request] Thumbnails on the fly
Tom – are you referring to the “hey guys, your img should be shorter” issue in Safari? I had that pop up with jmd_img_selector – I ended up floating the container and using position:relative, then position:absolute and top:0 for the image to get the img’s height to fill the container.
Offline
Re: [request] Thumbnails on the fly
jm wrote
are you referring to the “hey guys, your img should be shorter” issue in Safari?
I might be. Does it cause the height of the image to stay at it’s native size and not respect any scaling?
That’s what was happening to me. Can’t remember if height: auto;
was on the image or the container.
I’ve really got to go round up the CSS and report back with something meaningful.
;)
—
T
Offline