diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-08-24 21:27:21 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-08-24 21:27:21 +0200 |
commit | 47589421219cf8361cc725421a21f8426370c2ef (patch) | |
tree | 32bde74e303645248c095db4d0c265d11129af72 /lib/private/Preview/HEIC.php | |
parent | ed15a6f2a25f07f621f3f0966ad7691cd3c2e645 (diff) | |
download | nextcloud-server-47589421219cf8361cc725421a21f8426370c2ef.tar.gz nextcloud-server-47589421219cf8361cc725421a21f8426370c2ef.zip |
Fixes
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Preview/HEIC.php')
-rw-r--r-- | lib/private/Preview/HEIC.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/private/Preview/HEIC.php b/lib/private/Preview/HEIC.php index a071eb51ab3..54bc212b6b5 100644 --- a/lib/private/Preview/HEIC.php +++ b/lib/private/Preview/HEIC.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @author Thomas Müller <thomas.mueller@tmit.eu> * @@ -22,6 +23,8 @@ namespace OC\Preview; +use OCP\ILogger; + /** * Creates a JPG preview using ImageMagick via the PECL extension * @@ -31,15 +34,15 @@ class HEIC extends Provider { /** * {@inheritDoc} */ - public function getMimeType() { + public function getMimeType(): string { return '/image\/hei(f|c)/'; } /** * {@inheritDoc} */ - public function isAvailable(\OCP\Files\FileInfo $file) { - return in_array("HEIC", \Imagick::queryFormats("HEI*") ); + public function isAvailable(\OCP\Files\FileInfo $file): bool { + return in_array('HEIC', \Imagick::queryFormats("HEI*")); } /** @@ -88,7 +91,7 @@ class HEIC extends Provider { * @return \Imagick */ private function getResizedPreview($tmpPath, $maxX, $maxY) { - $bp = new Imagick(); + $bp = new \Imagick(); // Layer 0 contains either the bitmap or a flat representation of all vector layers $bp->readImage($tmpPath . '[0]'); @@ -127,7 +130,7 @@ class HEIC extends Provider { // the catrom filter is almost identical to Lanczos2, but according // to http://php.net/manual/en/imagick.resizeimage.php it is // significantly faster - $bp->resizeImage($maxX, $maxY, imagick::FILTER_CATROM, 1, true); + $bp->resizeImage($maxX, $maxY, \Imagick::FILTER_CATROM, 1, true); } } |