summaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/image.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-05-01 14:03:00 +0200
committerRobin Appelman <robin@icewind.nl>2017-05-02 13:43:47 +0200
commit4dfd90abc423ae34add34a2293c24de8b398246c (patch)
tree19a37c841dc6220e3cab8058f14645e9abc81e97 /lib/private/legacy/image.php
parent18b5e2fced13f0e7a00910029eeaad60ca8c78e6 (diff)
downloadnextcloud-server-4dfd90abc423ae34add34a2293c24de8b398246c.tar.gz
nextcloud-server-4dfd90abc423ae34add34a2293c24de8b398246c.zip
better handling of preview generation errors
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/legacy/image.php')
-rw-r--r--lib/private/legacy/image.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/legacy/image.php b/lib/private/legacy/image.php
index e26148bdf15..120b19d1cff 100644
--- a/lib/private/legacy/image.php
+++ b/lib/private/legacy/image.php
@@ -563,7 +563,7 @@ class OC_Image implements \OCP\IImage {
case IMAGETYPE_JPEG:
if (imagetypes() & IMG_JPG) {
if (getimagesize($imagePath) !== false) {
- $this->resource = imagecreatefromjpeg($imagePath);
+ $this->resource = @imagecreatefromjpeg($imagePath);
} else {
$this->logger->debug('OC_Image->loadFromFile, JPG image not valid: ' . $imagePath, array('app' => 'core'));
}
@@ -573,7 +573,7 @@ class OC_Image implements \OCP\IImage {
break;
case IMAGETYPE_PNG:
if (imagetypes() & IMG_PNG) {
- $this->resource = imagecreatefrompng($imagePath);
+ $this->resource = @imagecreatefrompng($imagePath);
// Preserve transparency
imagealphablending($this->resource, true);
imagesavealpha($this->resource, true);
@@ -583,14 +583,14 @@ class OC_Image implements \OCP\IImage {
break;
case IMAGETYPE_XBM:
if (imagetypes() & IMG_XPM) {
- $this->resource = imagecreatefromxbm($imagePath);
+ $this->resource = @imagecreatefromxbm($imagePath);
} else {
$this->logger->debug('OC_Image->loadFromFile, XBM/XPM images not supported: ' . $imagePath, array('app' => 'core'));
}
break;
case IMAGETYPE_WBMP:
if (imagetypes() & IMG_WBMP) {
- $this->resource = imagecreatefromwbmp($imagePath);
+ $this->resource = @imagecreatefromwbmp($imagePath);
} else {
$this->logger->debug('OC_Image->loadFromFile, WBMP images not supported: ' . $imagePath, array('app' => 'core'));
}