From 764ce1353330883aed5e846cd0d9628bd3968643 Mon Sep 17 00:00:00 2001 From: Paul van Schayck Date: Thu, 25 Mar 2004 16:23:42 +0000 Subject: [PATCH] Check $width $height input. Display full image if no $width $height given --- appimage.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/appimage.php b/appimage.php index 77e7b52..a159e55 100644 --- a/appimage.php +++ b/appimage.php @@ -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")