summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Paroz <github@oparoz.com>2015-06-18 13:30:10 +0200
committerOlivier Paroz <github@oparoz.com>2015-06-18 13:30:10 +0200
commit64f0fd08891ac5018fce8002246438b3e31159f6 (patch)
treeb2ad2e50c6048fe81c9781a5daecda69bbaf6774
parent8193e1d7c15485663eeaaa1af1480f1f19004c32 (diff)
downloadnextcloud-server-64f0fd08891ac5018fce8002246438b3e31159f6.tar.gz
nextcloud-server-64f0fd08891ac5018fce8002246438b3e31159f6.zip
Remove unneeded returns from private cropping methods
-rw-r--r--lib/private/preview.php22
1 files changed, 6 insertions, 16 deletions
diff --git a/lib/private/preview.php b/lib/private/preview.php
index 3a341500e67..731e9992310 100644
--- a/lib/private/preview.php
+++ b/lib/private/preview.php
@@ -812,9 +812,8 @@ class Preview {
*/
// It turns out the scaled preview is now too big, so we crop the image
if ($newPreviewWidth >= $askedWidth && $newPreviewHeight >= $askedHeight) {
- list($newPreviewWidth, $newPreviewHeight) =
- $this->crop($image, $askedWidth, $askedHeight, $newPreviewWidth, $newPreviewHeight);
- $this->storePreview($fileId, $newPreviewWidth, $newPreviewHeight);
+ $this->crop($image, $askedWidth, $askedHeight, $newPreviewWidth, $newPreviewHeight);
+ $this->storePreview($fileId, $askedWidth, $askedHeight);
return;
}
@@ -822,11 +821,10 @@ class Preview {
// At least one dimension of the scaled preview is too small,
// so we fill the space with a transparent background
if (($newPreviewWidth < $askedWidth || $newPreviewHeight < $askedHeight)) {
- list($newPreviewWidth, $newPreviewHeight) =
- $this->cropAndFill(
- $image, $askedWidth, $askedHeight, $newPreviewWidth, $newPreviewHeight
- );
- $this->storePreview($fileId, $newPreviewWidth, $newPreviewHeight);
+ $this->cropAndFill(
+ $image, $askedWidth, $askedHeight, $newPreviewWidth, $newPreviewHeight
+ );
+ $this->storePreview($fileId, $askedWidth, $askedHeight);
return;
}
@@ -894,8 +892,6 @@ class Preview {
* @param int $askedHeight
* @param int $previewWidth
* @param null $previewHeight
- *
- * @return \int[]
*/
private function crop($image, $askedWidth, $askedHeight, $previewWidth, $previewHeight = null) {
$cropX = floor(abs($askedWidth - $previewWidth) * 0.5);
@@ -904,8 +900,6 @@ class Preview {
$cropY = 0;
$image->crop($cropX, $cropY, $askedWidth, $askedHeight);
$this->preview = $image;
-
- return [$askedWidth, $askedHeight];
}
/**
@@ -917,8 +911,6 @@ class Preview {
* @param int $askedHeight
* @param int $previewWidth
* @param null $previewHeight
- *
- * @return \int[]
*/
private function cropAndFill($image, $askedWidth, $askedHeight, $previewWidth, $previewHeight) {
if ($previewWidth > $askedWidth) {
@@ -954,8 +946,6 @@ class Preview {
$image = new \OC_Image($backgroundLayer);
$this->preview = $image;
-
- return [$askedWidth, $askedHeight];
}
/**