	private function resize_gd($src, $width, $height, $quality, $srcImgInfo) {
		switch ($srcImgInfo['mime']) {
			case 'image/gif':
				if (@imagetypes() & IMG_GIF) {
					$oSrcImg = @imagecreatefromgif($src);
				} else {
					$ermsg = 'GIF images are not supported';
				}
				break;
			case 'image/jpeg':
				if (@imagetypes() & IMG_JPG) {
					$oSrcImg = @imagecreatefromjpeg($src) ;
				} else {
					$ermsg = 'JPEG images are not supported';
				}
				break;
			case 'image/png':
				if (@imagetypes() & IMG_PNG) {
					$oSrcImg = @imagecreatefrompng($src) ;
				} else {
					$ermsg = 'PNG images are not supported';
				}
				break;
			case 'image/wbmp':
				if (@imagetypes() & IMG_WBMP) {
					$oSrcImg = @imagecreatefromwbmp($src);
				} else {
					$ermsg = 'WBMP images are not supported';
				}
				break;
			default:
				$oSrcImg = false;
				$ermsg = $srcImgInfo['mime'].' images are not supported';
				break;
		}
		
		if ($oSrcImg &&  false != ($tmp = imagecreatetruecolor($width, $height))) {
			
			if (!imagecopyresampled($tmp, $oSrcImg, 0, 0, 0, 0, $width, $height, $srcImgInfo[0], $srcImgInfo[1])) {
				return false;
			}
		
			switch ($srcImgInfo['mime']) {
				case 'image/gif':
					imagegif($tmp, $src);
					break;
				case 'image/jpeg':
					imagejpeg($tmp, $src, $quality);
					break;
				case 'image/png':
					if (function_exists('imagesavealpha') && function_exists('imagealphablending')) {
						imagealphablending($tmp, false);
						imagesavealpha($tmp, true);
					}
					imagepng($tmp, $src);
					break;
				case 'image/wbmp':
					imagewbmp($tmp, $src);
					break;
			}
			
			imagedestroy($oSrcImg);
			imagedestroy($tmp);
		
			return true;
		
		}
		return false;
	}
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.