forked from ZwiiCMS-Team/ZwiiCMS
[10.0.066] makeThumb filtre extension plutôt que type mime
This commit is contained in:
parent
905825b47a
commit
3b501ce9cf
@ -36,7 +36,7 @@ class common {
|
|||||||
const THUMBS_WIDTH = 640;
|
const THUMBS_WIDTH = 640;
|
||||||
|
|
||||||
// Numéro de version
|
// Numéro de version
|
||||||
const ZWII_VERSION = '10.0.065';
|
const ZWII_VERSION = '10.0.066';
|
||||||
const ZWII_UPDATE_CHANNEL = "v10";
|
const ZWII_UPDATE_CHANNEL = "v10";
|
||||||
|
|
||||||
public static $actions = [];
|
public static $actions = [];
|
||||||
@ -792,20 +792,20 @@ class common {
|
|||||||
*/
|
*/
|
||||||
function makeThumb($src, $dest, $desired_width) {
|
function makeThumb($src, $dest, $desired_width) {
|
||||||
// Vérifier l'existence du dossier de destination.
|
// Vérifier l'existence du dossier de destination.
|
||||||
$path = pathinfo($dest);
|
$fileInfo = pathinfo($dest);
|
||||||
if (!is_dir($path['dirname'])) {
|
if (!is_dir($fileInfo['dirname'])) {
|
||||||
mkdir($path['dirname'],755,true);
|
mkdir($fileInfo['dirname'],755,true);
|
||||||
}
|
}
|
||||||
// Type d'image
|
// Type d'image
|
||||||
switch(mime_content_type($src) ) {
|
switch( $fileInfo['extension']) {
|
||||||
case 'image/jpeg':
|
case 'jpeg':
|
||||||
case 'image/jpg':
|
case 'jpg':
|
||||||
$source_image = imagecreatefromjpeg($src);
|
$source_image = imagecreatefromjpeg($src);
|
||||||
break;
|
break;
|
||||||
case 'image/png':
|
case 'png':
|
||||||
$source_image = imagecreatefrompng($src);
|
$source_image = imagecreatefrompng($src);
|
||||||
break;
|
break;
|
||||||
case 'image/gif':
|
case 'gif':
|
||||||
$source_image = imagecreatefromgif($src);
|
$source_image = imagecreatefromgif($src);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user