diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-01-13 00:34:28 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-01-17 10:00:33 +0100 |
commit | e4b3ee8d8f93262423eaaeee390deb6e680bb1e3 (patch) | |
tree | 3c24e04be9a760d73490fdc75f9ae788051eb886 /lib/private/Preview/GeneratorHelper.php | |
parent | 16f4d71efd257e66550d61013e39ecf96c10fa0f (diff) | |
download | nextcloud-server-e4b3ee8d8f93262423eaaeee390deb6e680bb1e3.tar.gz nextcloud-server-e4b3ee8d8f93262423eaaeee390deb6e680bb1e3.zip |
Fix float/integer handling in image API
* IImage::crop/preciseResize now have type hinting for integers
* found while testing strict typing for PHP 7+
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/Preview/GeneratorHelper.php')
-rw-r--r-- | lib/private/Preview/GeneratorHelper.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/Preview/GeneratorHelper.php b/lib/private/Preview/GeneratorHelper.php index 6535fde058b..587f8174b02 100644 --- a/lib/private/Preview/GeneratorHelper.php +++ b/lib/private/Preview/GeneratorHelper.php @@ -27,7 +27,7 @@ use OCP\Files\File; use OCP\Files\IRootFolder; use OCP\Files\SimpleFS\ISimpleFile; use OCP\IImage; -use OCP\Image as img; +use OCP\Image as OCPImage; use OCP\Preview\IProvider; /** @@ -79,7 +79,9 @@ class GeneratorHelper { * @return IImage */ public function getImage(ISimpleFile $maxPreview) { - return new img($maxPreview->getContent()); + $image = new OCPImage(); + $image->loadFromData($maxPreview->getContent()); + return $image; } /** |