/** * Create image resource * * @param string $format * @return resource * * @throws Exception */ protected function _imageCreate($format) { if (Helper::isJpeg($format)) { $result = imagecreatefromjpeg($this->_filename); } elseif (Helper::isPng($format)) { $result = imagecreatefrompng($this->_filename); } elseif (Helper::isGif($format)) { $result = imagecreatefromgif($this->_filename); } else { throw new Exception('Invalid image: ' . $this->_filename); // @codeCoverageIgnore } return $result; }