View Full Version : Image Thumbnail Viewer II image size

08-24-2007, 08:01 AM
I am using Image Thumbnail Viewer II and I love it.
I would like to know if we can change the size so that the larger image is alway . . . . . .let say 400 y 300. If my image is 640 x 480 or 800 x 600 . . I want them to be resized to lets say 400 by 300. Is there an easy way to do this?
thanks so much for any asssistance.

08-24-2007, 08:57 AM
Warning: Please include a link to the DD script in question in your post. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.

Please post a link to the page on your site that contains the problematic script so we can check it out.

08-24-2007, 03:19 PM
Here is the DD link . . . . . . . .


Here is a link to my site in question . . . . . . . .


Thanks for looking

08-24-2007, 04:02 PM
The best way, in my opinion is to use a batch image optimization program with a 'fit to box' resize option. I notice that your images seem to be rather large in byte size and low in resolution. If you were to start with the original images (assuming that you have them and that they are of a higher resolution), this would result in much less band width being used and in a better looking set of images. Even if you don't have the originals, or if these are the originals, their apparent resolution could still be improved and both their physical dimensions and byte load (band width) reduced using this method.

However, it has been my experience with some folks asking this type of question that they don't get how much better that would be, and/or couldn't be bothered.

You can still have the script/browser resize the images, though this will not reduce the band width and in some browsers will make the images of an even poorer looking quality. Some ways to do so - Find this line in the script:

var imageHTML='<img src="'+imagepath+'" style="border-width: 0" />' //Construct HTML for enlarged image

and add your dimensions there:

var imageHTML='<img src="'+imagepath+'" width="400" height="300" style="border-width: 0" />' //Construct HTML for enlarged image


var imageHTML='<img src="'+imagepath+'" style="width:400px;border-width: 0" />' //Construct HTML for enlarged image

Using the second method, the height will scale proportionately in most browsers, though some browsers will still distort the image even if they get the proportions right.