From 3b501ce9cfd75ed33759f7929541b5e03213e3f1 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Wed, 15 Apr 2020 20:00:30 +0200 Subject: [PATCH] =?UTF-8?q?[10.0.066]=20makeThumb=20filtre=20extension=20p?= =?UTF-8?q?lut=C3=B4t=20que=20type=20mime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/core.php b/core/core.php index 0c83c5df..4c28b130 100644 --- a/core/core.php +++ b/core/core.php @@ -36,7 +36,7 @@ class common { const THUMBS_WIDTH = 640; // Numéro de version - const ZWII_VERSION = '10.0.065'; + const ZWII_VERSION = '10.0.066'; const ZWII_UPDATE_CHANNEL = "v10"; public static $actions = []; @@ -792,20 +792,20 @@ class common { */ function makeThumb($src, $dest, $desired_width) { // Vérifier l'existence du dossier de destination. - $path = pathinfo($dest); - if (!is_dir($path['dirname'])) { - mkdir($path['dirname'],755,true); + $fileInfo = pathinfo($dest); + if (!is_dir($fileInfo['dirname'])) { + mkdir($fileInfo['dirname'],755,true); } // Type d'image - switch(mime_content_type($src) ) { - case 'image/jpeg': - case 'image/jpg': + switch( $fileInfo['extension']) { + case 'jpeg': + case 'jpg': $source_image = imagecreatefromjpeg($src); break; - case 'image/png': + case 'png': $source_image = imagecreatefrompng($src); break; - case 'image/gif': + case 'gif': $source_image = imagecreatefromgif($src); break; }