Welcome Guest, Not a member yet? Register   Sign In
Help with image lib - thumbnails
#1

[eluser]gRoberts[/eluser]
Hey all,

On a site I'm working on we are using the image lib to generate thumbnails.

The sites requirement is that we have 4 copies of the image:

images/thumb/image.ext = 100x100
images/med/image.ext = 250x250
images/large/image.ext = 800x600
images/image.ext = original image

I have created a class that uses the image lib, and it will resize the image to the width/height given, and save it to the path given.

This works fine if the image is larger then the given width/height but if the image is smaller then things start to go wrong.

At the moment I have told the class to simply copy the image rather then use the image lib to generate a thumbnail if the image is smaller then the required width/height but unfortunately some images are wider then the required width, or taller then the required height, which causes the script to copy an image that won't appear correctly because the width/height is wrong.

Has anyone had any experience with this?

Would you be able to see what i'm doing wrong, and possibly point out my flaws?

Thank you all in advance!

Gavin


Messages In This Thread
Help with image lib - thumbnails - by El Forum - 03-25-2008, 07:09 AM
Help with image lib - thumbnails - by El Forum - 03-26-2008, 04:53 PM
Help with image lib - thumbnails - by El Forum - 03-26-2008, 10:45 PM
Help with image lib - thumbnails - by El Forum - 03-27-2008, 06:06 AM
Help with image lib - thumbnails - by El Forum - 03-27-2008, 06:21 AM
Help with image lib - thumbnails - by El Forum - 03-27-2008, 09:31 AM
Help with image lib - thumbnails - by El Forum - 03-27-2008, 09:33 AM
Help with image lib - thumbnails - by El Forum - 03-27-2008, 09:38 AM
Help with image lib - thumbnails - by El Forum - 03-27-2008, 09:41 AM
Help with image lib - thumbnails - by El Forum - 03-27-2008, 09:48 AM
Help with image lib - thumbnails - by El Forum - 11-27-2008, 04:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB