Fix typo in last commit

pull/1001/head
Linwood-F 2015-08-09 18:41:12 -04:00
parent 6da8da9d8d
commit 4fedb5fce0
1 changed files with 6 additions and 6 deletions

View File

@ -65,7 +65,7 @@ else
}
}
$scale=100;
$scale=0;
if( !empty($_REQUEST['scale']) )
if (is_numeric($_REQUEST['scale']))
{
@ -102,18 +102,18 @@ else
$i = imagecreatefromjpeg ( ZM_DIR_EVENTS.'/'.$path );
$oldWidth=imagesx($i);
$oldHeight=imagesy($i);
if($width==0 && $height==0)
if($width==0 && $height==0) // scale has to be set to get here with both zero
{
$width=$oldWidth * $scale / 100.0;
$height=$oldHeight * $scale / 100.0;
$width = $oldWidth * $scale / 100.0;
$height= $oldHeight * $scale / 100.0;
}
elseif ($width==0 && $height!=0)
{
$width = ($oldWidth / $OldHeight) * $height;
$width = ($height * $oldWidth) / $oldHeight;
}
elseif ($width!=0 && $height==0)
{
$height = ($oldHeight / $oldWidth) * $width;
$height = ($width * $oldHeight) / $oldWidth;
}
if($width==$oldWidth && $height==$oldHeight) // See if we really need to scale
{