22
The thumbnails was all "wierdo" with this hack (I didn't notice if it was before the hack). If the image was in "portrait" aspectratio and not "landscape" the thumbnail was zoomed up and got pixelated.
I modded my own "modules/xoopsgallery/blocks/xoopsgallery_blocks.php" with the following code:
if( $hw[0] > $hw[1]) {
if (intval($options[1]) < $hw[0]) {
$image['width'] = intval($options[1]);
$image['height'] = $hw[1] * ($image['width'] / $hw[0]);
} else {
$image['width'] = $hw[0];
$image['height'] = $hw[1];
}
} else {
if (intval($options[1]) < $hw[1]) {
$image['height'] = intval($options[1]);
$image['width'] = $hw[0] * ($image['height'] / $hw[1]);
} else {
$image['width'] = $hw[0];
$image['height'] = $hw[1];
}
}
This was the code before I changed it:
if (intval($options[1]) < $hw[0]) {
$image['width'] = intval($options[1]);
$image['height'] = $hw[1] * ($image['width'] / $hw[0]);
} else {
$image['width'] = $hw[0];
$image['height'] = $hw[1];
}
I'm sure my conditional block might be improved, but it's 3am in the morning here, and I'm too tired to bother. With four glasses of red wine those lines of code took me two hours to get right *lol*