aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-07-16 21:47:35 +0200
committerGitHub <noreply@github.com>2024-07-16 21:47:35 +0200
commitd237fd0e78af8bbff51f2802efd4db1d88457579 (patch)
treea1de86753d20e9e0859945bf1e7edaa0a8149998
parent1f8999ea71152445678f27a39aa875d9f95c9b5d (diff)
parentc0e1503ce14ffcd06a1e72e945335460d4a996ab (diff)
downloadnextcloud-server-d237fd0e78af8bbff51f2802efd4db1d88457579.tar.gz
nextcloud-server-d237fd0e78af8bbff51f2802efd4db1d88457579.zip
Merge pull request #46342 from nextcloud/fix-getimagesize
-rw-r--r--lib/private/legacy/OC_Image.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/legacy/OC_Image.php b/lib/private/legacy/OC_Image.php
index cc6968839d4..622c1704b09 100644
--- a/lib/private/legacy/OC_Image.php
+++ b/lib/private/legacy/OC_Image.php
@@ -569,7 +569,7 @@ class OC_Image implements \OCP\IImage {
private function checkImageSize($path) {
$size = @getimagesize($path);
if (!$size) {
- return true;
+ return false;
}
$width = $size[0];
@@ -590,7 +590,7 @@ class OC_Image implements \OCP\IImage {
private function checkImageDataSize($data) {
$size = @getimagesizefromstring($data);
if (!$size) {
- return true;
+ return false;
}
$width = $size[0];
@@ -637,7 +637,7 @@ class OC_Image implements \OCP\IImage {
if (!$this->checkImageSize($imagePath)) {
return false;
}
- if (getimagesize($imagePath) !== false) {
+ if (@getimagesize($imagePath) !== false) {
$this->resource = @imagecreatefromjpeg($imagePath);
} else {
$this->logger->debug('OC_Image->loadFromFile, JPG image not valid: ' . $imagePath, ['app' => 'core']);