protected function gdImage($image, $filename, $destformat, $mime ){

		if ($destformat == 'jpg' || ($destformat == null && $mime == 'image/jpeg')) {
			return imagejpeg($image, $filename, 100);
		}

		if ($destformat == 'gif' || ($destformat == null && $mime == 'image/gif')) {
			return imagegif($image, $filename, 7);
		}

		return imagepng($image, $filename, 7);
	}
protected function gdImage($image, $filename, $destformat, $mime ){

		if ($destformat == 'jpg' || ($destformat == null && $mime == 'image/jpeg')) {
			return imagejpeg($image, $filename, 100);
		}

		if ($destformat == 'gif' || ($destformat == null && $mime == 'image/gif')) {
			return imagegif($image, $filename, 7);
		}

		return imagepng($image, $filename, 7);
	}
protected function gdImage ( $ image , $ filename , $ destformat , $ mime ) { if ( $ destformat == 'jpg' || ( $ destformat == null && $ mime == 'image/jpeg' ) ) { return imagejpeg ( $ image , $ filename , 100 ) ; } if ( $ destformat == 'gif' || ( $ destformat == null && $ mime == 'image/gif' ) ) { return imagegif ( $ image , $ filename , 7 ) ; } return imagepng ( $ image , $ filename , 7 ) ; }
Output gd image to file

@param resource $image gd image resource
@param string $filename The path to save the file to.
@param string $destformat The Image type to use for $filename
@param string $mime The original image mime type
Output gd image to file