[Pkg-owncloud-commits] [owncloud] 334/457: Make sure we have a resource before measuring its size

David Prévot taffit at moszumanska.debian.org
Sun Jun 28 20:06:35 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 3d0a52321791309e06843123a460fd9ad24d89c0
Author: Olivier Paroz <github at oparoz.com>
Date:   Mon Jun 8 15:10:29 2015 +0200

    Make sure we have a resource before measuring its size
---
 lib/private/image.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/private/image.php b/lib/private/image.php
index 54e5ef7..fad0b53 100644
--- a/lib/private/image.php
+++ b/lib/private/image.php
@@ -982,10 +982,14 @@ class OC_Image implements \OCP\IImage {
 	 * @return bool
 	 */
 	public function scaleDownToFit($maxWidth, $maxHeight) {
+		if (!$this->valid()) {
+			$this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core'));
+			return false;
+		}
 		$widthOrig = imageSX($this->resource);
 		$heightOrig = imageSY($this->resource);
 
-		if ($widthOrig > $maxWidth || $heightOrig >$maxHeight) {
+		if ($widthOrig > $maxWidth || $heightOrig > $maxHeight) {
 			return $this->fitIn($maxWidth, $maxHeight);
 		}
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list