You are here

function FMDiskFileSystem::getImageOriginal in N1ED - Visual editor as CKEditor plugin with Bootstrap support 7

Overrides IFMDiskFileSystem::getImageOriginal

File

vendor/edsdk/flmngr-server-php/src/fs/FMDiskFileSystem.php, line 605

Class

FMDiskFileSystem

Namespace

EdSDK\FlmngrServer\fs

Code

function getImageOriginal($filePath) {
  $mimeType = FMDiskFileSystem::getMimeType($filePath);
  if ($mimeType == NULL) {
    throw new MessageException(FMMessage::createMessage(FMMessage::FM_FILE_IS_NOT_IMAGE));
  }
  $fullPath = $this
    ->getAbsolutePath($filePath);
  if (file_exists($fullPath)) {
    $f = fopen($fullPath, 'rb');
    if ($f) {
      return [
        $mimeType,
        $f,
      ];
    }
  }
  throw new MessageException(FMMessage::createMessage(FMMessage::FM_FILE_DOES_NOT_EXIST));
}