PDA

View Full Version : A auto thumbnail plugin


Donace
11-10-2008, 11:24 PM
I'm starting to use a lot of images for my articles and when i've been playing around with themes Some themes have a larger 'content' area.

So what i'm ideally after is a plugin or a theme hack that 'thumbnails' or reduces to the image so to fit the content area. (while keeping aspect ratio). I ideally want to show the maximum I can show for each image and don't want to keep editing the 'size' variable for the image tags.

I mean at the moment im using Shutter reloaded (http://www.laptoptips.ca/projects/wp-shutter-reloaded/) Which is nice to use to get nice effects with no lag added, but it doesn't 'correct the image'.

Any help appreciated

Cheers

(BTW like the new 'ranks')

Kevin
11-10-2008, 11:57 PM
You can change the default thumbnail and medium image settings via the miscellaneous tab in the settings area. Think the default for thumbnail is 150x150 and medium is 300.

Not sure if thats what you are looking for though.

Donace
11-11-2008, 09:56 AM
hey kevin..no thats more to do with if I select the image as a thumbnail while i,m inserting it in the post (i think), What i'm after is something that does it no matter what size I inserted the image at.

sarahG
11-11-2008, 12:11 PM
The sizes that Kevin specified are for use with the media uploader.

Where are you inserting images from?

If I've read this right, you want to be able to use an image on your server and insert it into a post. Then when you save the post the image used will automatically be resized to fit into the post appropriately? If so then no there's nothing going to be around for that as it's too complicated to be honest.

Otherwise I think you'll need to expand on your idea/method so that we can work out what you mean :)

Donace
11-11-2008, 01:54 PM
actually sarah that is what I mean!
for example http://thenexus.tk/a-basic-guide-to-video-conversion-using-super/ some of the images go off the page; Now I dont want to edit each images attributes so it fits in the 'content' area.

Is there possibly a way somehow to say

If width = > X then reduce width and height by Y%?

Kevin
11-11-2008, 02:05 PM
actually sarah that is what I mean!
for example http://thenexus.tk/a-basic-guide-to-video-conversion-using-super/ some of the images go off the page; Now I dont want to edit each images attributes so it fits in the 'content' area.

Is there possibly a way somehow to say

If width = > X then reduce width and height by Y%?

if you upload these images via wordpress then it will do this automatically for you

your main content area is around 625 pixels. Wordpress reduces images to 500 pixels in width though you could increase this to 600 if you want to (and resizes he height accordingly too).

Donace
11-11-2008, 02:25 PM
@ kevin I did add those via wordpress :p and that was the result...

Kevin
11-11-2008, 02:56 PM
@ kevin I did add those via wordpress :p and that was the result...

well my first thought is that you are either using an older version of wordpress or you have disabled the resizing. All wordpress blogs have the resizing setup as default so theres a chance you disabled it at one point without realising it.

slee
11-11-2008, 04:20 PM
im not sure if this is relevant to you but this is a great script for thumbnailing images for certain parts of your site.
http://www.darrenhoyt.com/2008/04/02/timthumb-php-script-released/

sarahG
11-11-2008, 05:00 PM
Donace, you're using at least WP 2.5 judging by your admin login. So this means that when you upload an image it should resize to 2 smaller sizes. As Kevin said, by default this is 500px max height/width for the medium size. You can change this under Settings -> Miscellaneous.

The images you've inserted into your post are the non-resized versions. When you use the media upload, upload the image, then click to show it. You can change the title, give a description etc. Then just above the 'insert into post' you can select thumbnail, medium and original (or something like that). Select the medium size to get the resized version.

At present you're inserting the original so it will display an unresized version.

Kevin
11-11-2008, 05:29 PM
Donace, you're using at least WP 2.5 judging by your admin login. So this means that when you upload an image it should resize to 2 smaller sizes. As Kevin said, by default this is 500px max height/width for the medium size. You can change this under Settings -> Miscellaneous.

The images you've inserted into your post are the non-resized versions. When you use the media upload, upload the image, then click to show it. You can change the title, give a description etc. Then just above the 'insert into post' you can select thumbnail, medium and original (or something like that). Select the medium size to get the resized version.

At present you're inserting the original so it will display an unresized version.

Actually, I think medium changes it to 300 pixels by default. Clicking on Full Size should add the 500 pixels resized image.

sarahG
11-11-2008, 08:42 PM
Actually, I think medium changes it to 300 pixels by default. Clicking on Full Size should add the 500 pixels resized image.

Ahh sorry, wasn't fully concentrating (it's been a long day).

yes by default the medium is 300px by 300px. However, Donace is still loading the full size original image into his posts and not a resized version. A resized version would have an image name of filename-300x300.jpg for example, with the original being filename.jpg

Edit: Ahh, I understand why you're mentioning 500px.

If you select full size from the Media Uploader it will insert an image with a max height/width of 500px. However this isn't the size of the image this is restricted using the attributes height and width. The actual image is the original size. I don't know why WP does this. I came across it when I was setting up my photo blog as I wanted my photos at 600px wide.

Thumbnail and Medium are set under Settings -> Miscellaneous, however full size is either the full size if less than 500px height/width, otherwise it's the full size image (regardless of size) and restricted by html height and width attributes. Remove these and you'll get the full size image.

So Donace, if you're using the media uploader, set your medium size to the width you want your images to be and add these to your posts. My guess is you've been using the full size and removing the height and width attributes.

Jeffro
11-12-2008, 03:55 AM
You can change the default thumbnail and medium image settings via the miscellaneous tab in the settings area. Think the default for thumbnail is 150x150 and medium is 300.

Not sure if thats what you are looking for though.

Although I would suggest using the same method as Kevin mentioned, this won't auto thumbnail images that keep the aspect ratio so the images look good even when shrunk down. The only way to do this I have found is to do it manually.

Donace
11-22-2008, 12:01 PM
Found a very simple and effective way to stop the over flow...CSS is genius :D

Just add this to the style sheet and the images will never overflow!

p img {
padding: 0;
max-width: 100%;
}

ap4a
11-22-2008, 01:14 PM
Found a very simple and effective way to stop the over flow...CSS is genius :D

Just add this to the style sheet and the images will never overflow!


Or use the property created for this:


p { overflow: hidden; }



Or, if you'd like to have it scroll instead of cropping the end off:


p { overflow: auto; }


Using either HTML or CSS to modify the dimensions of an image isn't a good idea as it's liable to distort the image making it look bad.