classes/BannerImage.php
public function getBannerImageSizeNew($oldWidth,$oldHeight,$newWidth=0,$newHeight=0)
	{
		$Width   = $oldWidth;  //Default, and flash require this
		$Height  = $oldHeight; //Default, and flash require this
		$oriSize = true;       //Attribute for images without conversion
		
		if ($newWidth > 0 && $newHeight > 0) 
		{
			$Width   = $newWidth;
			$Height  = $newHeight;
			$oriSize = false;
		}
		elseif ($newWidth > 0)
		{
			$Width   = $newWidth;
			$Height  = ceil($newWidth * $oldHeight / $oldWidth);
			$oriSize = false;
		}
		elseif ($newHeight > 0)
		{
			$Width   = ceil($newHeight * $oldWidth / $oldHeight);
			$Height  = $newHeight;
			$oriSize = false;
		}
		return array($Width,$Height,$oriSize);
	}
public function getBannerImageSizeNew($oldWidth,$oldHeight,$newWidth=0,$newHeight=0)
	{
		$Width   = $oldWidth;  //Default, and flash require this
		$Height  = $oldHeight; //Default, and flash require this
		$oriSize = true;       //Attribute for images without conversion
		
		if ($newWidth > 0 && $newHeight > 0) 
		{
			$Width   = $newWidth;
			$Height  = $newHeight;
			$oriSize = false;
		}
		elseif ($newWidth > 0)
		{
			$Width   = $newWidth;
			$Height  = ceil($newWidth * $oldHeight / $oldWidth);
			$oriSize = false;
		}
		elseif ($newHeight > 0)
		{
			$Width   = ceil($newHeight * $oldWidth / $oldHeight);
			$Height  = $newHeight;
			$oriSize = false;
		}
		return array($Width,$Height,$oriSize);
	}
public function getBannerImageSizeNew ( $ oldWidth , $ oldHeight , $ newWidth = 0 , $ newHeight = 0 ) { $ Width = $ oldWidth ; //Default, and flash require this $ Height = $ oldHeight ; //Default, and flash require this $ oriSize = true ; //Attribute for images without conversion if ( $ newWidth > 0 && $ newHeight > 0 ) { $ Width = $ newWidth ; $ Height = $ newHeight ; $ oriSize = false ; } elseif ( $ newWidth > 0 ) { $ Width = $ newWidth ; $ Height = ceil ( $ newWidth * $ oldHeight / $ oldWidth ) ; $ oriSize = false ; } elseif ( $ newHeight > 0 ) { $ Width = ceil ( $ newHeight * $ oldWidth / $ oldHeight ) ; $ Height = $ newHeight ; $ oriSize = false ; } return array ( $ Width , $ Height , $ oriSize ) ; }
Calculate the new size for witdh and height

@param int 		$oldWidth	,mandatory
@param int 		$oldHeight	,mandatory
@param int 		$newWidth	,optional
@param int 		$newHeight	,optional
@return array	$Width,$Height,$oriSize
Calculate the new size for witdh and height