示例#1
0
 public function find($path)
 {
     try {
         $binaryFile = $this->ioService->loadBinaryFile($path);
     } catch (NotFoundException $e) {
         throw new NotLoadableException("Source image not found in {$path}", 0, $e);
     }
     $mimeType = $binaryFile->mimeType;
     return new Binary($this->ioService->getFileContents($binaryFile), $mimeType, $this->extensionGuesser->guess($mimeType));
 }
示例#2
0
 public function find($path)
 {
     try {
         $binaryFile = $this->ioService->loadBinaryFile($path);
         // Treat a MissingBinaryFile as a not loadable file.
         if ($binaryFile instanceof MissingBinaryFile) {
             throw new NotLoadableException("Source image not found in {$path}");
         }
         $mimeType = $this->ioService->getMimeType($path);
         return new Binary($this->ioService->getFileContents($binaryFile), $mimeType, $this->extensionGuesser->guess($mimeType));
     } catch (NotFoundException $e) {
         throw new NotLoadableException("Source image not found in {$path}", 0, $e);
     }
 }
示例#3
0
 public function getFileContents(BinaryFile $binaryFile)
 {
     return $this->publishedIOService->getFileContents($binaryFile);
 }