![]() |
thumbnail script is producing poor quality thumbs please help
Hi All,
i have a thumbnail generator function PHP Code:
now because its just resizing the images they are distorted and dont look as good as they could/should. i looked on facebooks gallery and they have a square thumbnail image similar to mine but it is perfect no stretched images and the main part of the image is always in shot and quite close up. so my question is how do i modify the above function to produce better quality thumbnails? many thanks Luke |
This line
Code:
$new_height = $thumbWidth;#floor( $height * ( $thumbWidth / $width ) );Code:
floor( $height * ( $thumbWidth / $width ) );You might have to change the dimensions of the displayed thumb nail to make it square and uniform again. |
hi mate thanks for your reply,
i did what you suggested and it does improve the quality but the image heights are all different some are less than the required 148px. should i find out whether the image is portrait or landscape and then perform the above suggestion on either the height or width depending on which is longer? then i would need to crop them so that they are square again? is this correct thanks Luke |
Yes you need to crop the larger than 148px. Easy way is to put image into a div with these dimensions. If you have to move the image around in the div use relative posioning on the image.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">Code:
// calculate thumbnail size |
I'm not sure of the exact syntax but I would also consider setting the jpg quality settings - maybe try a 90. The quality would be the last change made to an image, just before saving it.
Quick example - will need research for correct syntax. PHP Code:
------- |
| All times are GMT +1. The time now is 07:51 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.