Check $width $height input. Display full image if no $width $height given
This commit is contained in:
committed by
Jeremy Newman
parent
65da531221
commit
764ce13533
12
appimage.php
12
appimage.php
@@ -38,6 +38,13 @@ if(!$versionId) {
|
|||||||
|
|
||||||
opendb();
|
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) )
|
if($imageId AND is_numeric($imageId) )
|
||||||
$result = mysql_query("SELECT * FROM appData WHERE id = $imageId");
|
$result = mysql_query("SELECT * FROM appData WHERE id = $imageId");
|
||||||
|
|
||||||
@@ -83,6 +90,11 @@ if($width && $height)
|
|||||||
$sim = ImageCreate($width, $height);
|
$sim = ImageCreate($width, $height);
|
||||||
ImageCopyResized($sim, $im, 0, 0, 0, 0, $width, $height, ImageSX($im), ImageSY($im));
|
ImageCopyResized($sim, $im, 0, 0, 0, 0, $width, $height, ImageSX($im), ImageSY($im));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// display full image
|
||||||
|
$sim = $im;
|
||||||
|
}
|
||||||
|
|
||||||
// output the image
|
// output the image
|
||||||
if($type == "png")
|
if($type == "png")
|
||||||
|
|||||||
Reference in New Issue
Block a user