From 6eb697e427b150233f8588b1eb01f576bd53f826 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Sat, 11 Apr 2020 14:33:10 +0200 Subject: [PATCH] =?UTF-8?q?Gallery=20:=20upload=20par=20ftp,=20=20dossier?= =?UTF-8?q?=20miniature=20non=20cr=C3=A9=C3=A9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/core.php b/core/core.php index c5826838..ae4aecf2 100644 --- a/core/core.php +++ b/core/core.php @@ -794,8 +794,12 @@ 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']); + } + // Image jpeg if (mime_content_type($src) === 'image/jpeg' ) { if ($source_image = imagecreatefromjpeg($src)) { $width = imagesx($source_image); @@ -811,6 +815,7 @@ class common { } } + // image png if ( mime_content_type($src) === 'image/png' ) { /* read the source image */ if ($source_image = imagecreatefrompng($src)) {;