How would I keep images proportional, but never have a width over 115px or a height over 100px? Just look at this site:
http://stock.d2.hu/index.phtml?f=s&c=101
Here is the code I'm trying to work with:
$dim = getimagesize($pics[$i]);
if($dim[0] > $config['max_width'] || $dim[1] > $config['max_height']){
if($dim[0] > 115){
$width = 115;
}else{
$width = $config['max_width'];
}
if($dim[1] > 100){
$height = 100;
}else{
$height = $config['max_height'];
}
$image = "<img src='{$pics[$i]}' width='{$width}' height='{$height}' border='0'>";
}else{
$image = "<img src='{$pics[$i]}' border='0'>";
}
Could someone gimme a quick hand?🙂