$height) { $new_width = $max_width; $new_height = $height * ($max_width/$width); } $image_p = imagecreatetruecolor($new_width, $new_height); imagecopyresampled($image_p, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height); $thumnail = $info['dirname'].DIRECTORY_SEPARATOR.$info['filename'].'_thumb.'.$extension; if ($imagefunc == 'imagegif' || $imagefunc == 'imagepng' ) { call_user_func($imagefunc, $image_p, $thumnail); } else { call_user_func($imagefunc, $image_p, $thumnail, 30); } return str_replace($_SERVER['DOCUMENT_ROOT'], "", $thumnail); } else { return ""; } } else { return ""; } return sfView::NONE; } }