aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Preview/HEIC.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Preview/HEIC.php')
-rw-r--r--lib/private/Preview/HEIC.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/Preview/HEIC.php b/lib/private/Preview/HEIC.php
index 68c83fad97d..f2d43564c99 100644
--- a/lib/private/Preview/HEIC.php
+++ b/lib/private/Preview/HEIC.php
@@ -30,6 +30,7 @@ declare(strict_types=1);
namespace OC\Preview;
use OCP\Files\File;
+use OCP\Files\FileInfo;
use OCP\IImage;
use OCP\ILogger;
@@ -49,7 +50,7 @@ class HEIC extends ProviderV2 {
/**
* {@inheritDoc}
*/
- public function isAvailable(\OCP\Files\FileInfo $file): bool {
+ public function isAvailable(FileInfo $file): bool {
return in_array('HEIC', \Imagick::queryFormats("HEI*"));
}
@@ -57,6 +58,10 @@ class HEIC extends ProviderV2 {
* {@inheritDoc}
*/
public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage {
+ if (!$this->isAvailable($file)) {
+ return null;
+ }
+
$tmpPath = $this->getLocalFile($file);
// Creates \Imagick object from the heic file