From f74e1f8fa357f85f08f1fb2cbeb32104f8c244f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Dec 2019 08:11:23 +0100 Subject: [PATCH] # WARNING: head commit changed in the meantime Restore file for travis --- htdocs/core/lib/images.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index c40e0c1e406..93174a7c390 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -325,7 +325,6 @@ function correctExifImageOrientation($fileSource, $fileDest, $quality = 95) if (function_exists('exif_read_data')) { $exif = exif_read_data($fileSource); if ($exif && isset($exif['Orientation'])) { - $infoImg = getimagesize($fileSource); // Get image infos $orientation = $exif['Orientation']; @@ -531,12 +530,13 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', $extImg = '.bmp'; break; } + if (! is_resource($img)) { dol_syslog('Failed to detect type of image. We found infoImg[2]='.$infoImg[2], LOG_WARNING); return 0; } - + $exifAngle = false; if ($ort && !empty($conf->global->MAIN_USE_EXIF_ROTATION)) { switch($ort)