diff options
author | Georg Ehrke <developer@georgehrke.com> | 2013-07-10 13:38:42 +0200 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2013-07-10 13:38:42 +0200 |
commit | 45d16916718ea103b371da9c7bef0385717d8cef (patch) | |
tree | 7c05434c128a01b472dd275b9d105bce2040bd84 /lib/preview.php | |
parent | a357e5b284ed5b752864e4570cb179f3f2d88229 (diff) | |
download | nextcloud-server-45d16916718ea103b371da9c7bef0385717d8cef.tar.gz nextcloud-server-45d16916718ea103b371da9c7bef0385717d8cef.zip |
fix orientation before caching preview
Diffstat (limited to 'lib/preview.php')
-rwxr-xr-x | lib/preview.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/preview.php b/lib/preview.php index f12107c9f57..6173fc8aa6b 100755 --- a/lib/preview.php +++ b/lib/preview.php @@ -332,7 +332,7 @@ class Preview { $preview = $provider->getThumbnail($file, $maxX, $maxY, $scalingup, $this->fileview); - if(!$preview) { + if(!($preview instanceof \OC_Image)) { continue; } @@ -346,6 +346,8 @@ class Preview { if($this->userview->is_dir(self::THUMBNAILS_FOLDER . '/' . $fileid . '/') === false) { $this->userview->mkdir(self::THUMBNAILS_FOLDER . '/' . $fileid . '/'); } + + $preview->fixOrientation(); $this->userview->file_put_contents($cachepath, $preview->data()); break; @@ -382,8 +384,6 @@ class Preview { * @return image */ public function resizeAndCrop() { - $this->preview->fixOrientation(); - $image = $this->preview; $x = $this->maxX; $y = $this->maxY; |