diff options
author | Olivier Paroz <github@oparoz.com> | 2015-08-25 03:43:50 +0300 |
---|---|---|
committer | Olivier Paroz <github@oparoz.com> | 2015-08-25 03:43:50 +0300 |
commit | 182938dee9444c7744a6cbf0e63b22b96da142c3 (patch) | |
tree | f348a38a795615c9c11d82354084d515891844b9 /preview | |
parent | be0c66adc70fbf372acfc08cced7e59a8861a351 (diff) |
Some tests for the Preview class
Diffstat (limited to 'preview')
-rw-r--r-- | preview/preview.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/preview/preview.php b/preview/preview.php index d64c8c46..25c0c5b0 100644 --- a/preview/preview.php +++ b/preview/preview.php @@ -194,7 +194,7 @@ class Preview { /** * Makes a preview fit in the asked dimension and, if required, fills the empty space * - * @param \OC_Image $previewData + * @param \OCP\IImage $previewData * @param int $previewWidth * @param int $previewHeight * @param int $maxWidth @@ -220,7 +220,7 @@ class Preview { /** * Makes a preview fit in the asked dimension and, if required, fills the empty space * - * @param \OC_Image $previewData + * @param \OCP\IImage $previewData * @param int $previewWidth * @param int $previewHeight * @param int $maxWidth @@ -252,7 +252,7 @@ class Preview { /** * Mixes a transparent background with a resized foreground preview * - * @param \OC_Image $previewData + * @param \OCP\IImage $previewData * @param int $previewWidth * @param int $previewHeight * @param int $newWidth @@ -321,22 +321,22 @@ class Preview { * * @param resource $fixedPreview * - * @return \OC_Image + * @return \OCP\IImage */ private function fixPreviewCache($fixedPreview) { $owner = $this->userId; $file = $this->file; $preview = $this->preview; $fixedPreviewObject = new Image($fixedPreview); - $previewData = $preview->getPreview(); - // Get the location where the broken thumbnail is stored $thumbnailFolder = $this->dataDir . '/' . $owner . '/'; $thumbnail = $thumbnailFolder . $preview->isCached($file->getId()); // Caching it for next time if ($fixedPreviewObject->save($thumbnail)) { - $previewData = $fixedPreviewObject->data(); + $previewData = $fixedPreviewObject; + } else { + $previewData = $preview->getPreview(); } return $previewData; |