original_string: 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);
  	}
code: 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);
  	}
code_tokens: 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 ) ; }
docstring: 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
docstring_tokens: Output gd image to file