include 'imageEdit.php'; function roundImage($image, $size, $text){ $corner = $size.'Corner'; switch($size){ case 'xSmall': $bgPos = '3px'; $pad = '1px'; $fontStyle = 'normal'; $fontSize = '7px;'; $imageSize = 25; case 'small': $bgPos = '5px'; $pad = '1px'; $fontStyle = 'normal'; $fontSize = '8px;'; $imageSize = 50; break; case 'medium': $bgPos = '10px'; $pad = '2px'; $fontStyle = 'normal'; $fontSize = '9px;'; $imageSize = 85; break; case 'big'; $bgPos = '15px'; $pad = '5px'; $fontStyle = 'italic'; $fontSize = '11px;'; $imageSize = 225; break; } $thisImage = new createImage(); $thisImage -> load(substr($image,1)); $w = $thisImage -> getWidth(); $h = $thisImage -> getHeight(); if($w > $h){ $thisImage -> resizeToHeight($imageSize); }else{ $thisImage -> resizeToWidth($imageSize); } $h = $thisImage -> getHeight(); $w = $thisImage -> getWidth(); $thisImage = ''; if($text != false){ $imageText = '

'.$text.'

'; } return '
'.imageElement($image, $w, $h, $imageSize).$imageText.'
'; } function imageElement($imagePath, $width, $height, $maxSize){ $style = ''; if($width < $height){ $style .= 'width:'.$maxSize.'px;'; $style .= 'bottom: -'.ceil(($height - $maxSize) / 2).'px;'; $style .= 'left: 0px;'; }else{ $style .= 'height:'.$maxSize.'px;'; $style .= 'left: -'.ceil(($width - $maxSize) / 2).'px;'; $style .= 'bottom:0px;'; } return ''; }