protected function initSourceImageResource() 
    { 
    	$ext = $this->getExtension();
    	
    	switch($ext) {
		case 'gif':
			$this->sourceImageResource = ImageCreateFromGif($this->sourceImagePath);
			break;
    	
		case 'jpg':
			$this->sourceImageResource = ImageCreateFromJpeg($this->sourceImagePath);
			break;
    	
		case 'png':
			$this->sourceImageResource = ImageCreateFromPng($this->sourceImagePath);
			break;
    	
		default:
			throw new \RuntimeException("An error occurred trying to create the image, extension '" . $ext. "' is not supported");
			break;
    	}
    	
    	return $this;
    }