/** * {@inheritDoc} */ public function load($path) { try { $contents = $this->filesystem->read($path); } catch (FileNotFoundException $e) { throw new Exception\ImageNotFoundException(sprintf('Source image not found in "%s"', $path)); } $mimeType = $this->filesystem->getMimeType($path); if ($mimeType === false) { // Mime Type could not be detected return $contents; } return new Binary($contents, $mimeType); }