function FMDiskFileSystem::getImageOriginal in N1ED - Visual editor as CKEditor plugin with Bootstrap support 8.2
Gets image original.
Overrides FMDiskFileSystemInterface::getImageOriginal
File
- src/
Flmngr/ FlmngrServer/ fs/ FMDiskFileSystem.php, line 609
Class
- FMDiskFileSystem
- Implements file system interface. Provides an interface to access file system (local disc FS). This is the correct module to replace if you want to implement some custom file system support (i. e. network file system like Amazon S3).
Namespace
Drupal\n1ed\Flmngr\FlmngrServer\fsCode
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));
}