public function loadFile($file) { $this->resource = null; try { $this->resource = new Imagick($file); } catch (\ImagickException $e) { throw new \RuntimeException("Image '" . $file . "' is not readable or does not exists.", 0, $e); } }