  		//check if image object is valid
  		return $image->valid() ? $image : false;
  	}
-+
+-}
+ 
 +	/**
 +	 * Returns a preview of maxX times maxY dimensions in PNG format
 +	 *

From 3783c3ade4f52b643a70ca44ff6c1abdf81fb4f5 Mon Sep 17 00:00:00 2001
From: Olivier Paroz <github@oparoz.com>
Date: Fri, 23 Jan 2015 18:04:52 +0100
Subject: [PATCH 1/2] The bitmap preview class now takes maxX and maxY into
 consideration when generating previews This is a fix for
 https://github.com/owncloud/core/issues/13607 and is part of the global
 programme: https://github.com/owncloud/core/issues/13609

---
 lib/private/preview/bitmap.php | 110 +++++++++++++++++++++++++++++++++++++----
 1 file changed, 101 insertions(+), 9 deletions(-)

diff --git a/lib/private/preview/bitmap.php b/lib/private/preview/bitmap.php
index 25f65cf..80c8863 100644
--- a/lib/private/preview/bitmap.php
+++ b/lib/private/preview/bitmap.php
@@ -1,6 +1,7 @@
 <?php
 /**

  * This file is licensed under the Affero General Public License version 3 or
  * later.
  * See the COPYING-README file.
@@ -8,31 +9,93 @@
 
 namespace OC\Preview;
 
+use Imagick;
+
+/**
