Check $width $height input. Display full image if no $width $height given

This commit is contained in:
Paul van Schayck
2004-03-25 16:23:42 +00:00
committed by Jeremy Newman
parent 65da531221
commit 764ce13533

View File

@@ -38,6 +38,13 @@ if(!$versionId) {
opendb();
// We have input, but wrong input
if( ( $width AND !is_numeric($width) ) || ( $height AND !is_numeric($height) ) )
{
$width = 100;
$height = 75;
}
if($imageId AND is_numeric($imageId) )
$result = mysql_query("SELECT * FROM appData WHERE id = $imageId");
@@ -83,6 +90,11 @@ if($width && $height)
$sim = ImageCreate($width, $height);
ImageCopyResized($sim, $im, 0, 0, 0, 0, $width, $height, ImageSX($im), ImageSY($im));
}
else
{
// display full image
$sim = $im;
}
// output the image
if($type == "png")