Skip to content
Extraits de code Groupes Projets
Valider dc1fc5e6 rédigé par RealET's avatar RealET Validation de cerdic
Parcourir les fichiers

fix : il ne faut pas contraindre la taille des SVG


(et plus généralement des images vectorielles)

Co-authored-by: default avatarRealET <real3t@gmail.com>
Refs: https://git.spip.net/spip/medias/pulls/4893


Co-authored-by: default avatarRealET <realet@noreply.git.spip.net>
Co-committed-by: default avatarRealET <realet@noreply.git.spip.net>
parent 3e8ecc0f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -39,22 +39,25 @@ function inc_verifier_taille_document_acceptable_dist(&$infos, $is_logo = false) ...@@ -39,22 +39,25 @@ function inc_verifier_taille_document_acceptable_dist(&$infos, $is_logo = false)
} }
} // si c'est une image } // si c'est une image
else { else {
if ($is_logo) { // Ne pas contraindre les dimensions des images vectorielles, ça n'a pas de sens
$max_width = (defined('_LOGO_MAX_WIDTH') and _LOGO_MAX_WIDTH) ? _LOGO_MAX_WIDTH : null; if ($infos['type_image'] !== 'svg') {
$max_height = (defined('_LOGO_MAX_HEIGHT') and _LOGO_MAX_HEIGHT) ? _LOGO_MAX_HEIGHT : null; if ($is_logo) {
$min_width = (defined('_LOGO_MIN_WIDTH') and _LOGO_MIN_WIDTH) ? _LOGO_MIN_WIDTH : null; $max_width = (defined('_LOGO_MAX_WIDTH') and _LOGO_MAX_WIDTH) ? _LOGO_MAX_WIDTH : null;
$min_height = (defined('_LOGO_MIN_HEIGHT') and _LOGO_MIN_HEIGHT) ? _LOGO_MIN_HEIGHT : null; $max_height = (defined('_LOGO_MAX_HEIGHT') and _LOGO_MAX_HEIGHT) ? _LOGO_MAX_HEIGHT : null;
} $min_width = (defined('_LOGO_MIN_WIDTH') and _LOGO_MIN_WIDTH) ? _LOGO_MIN_WIDTH : null;
else { $min_height = (defined('_LOGO_MIN_HEIGHT') and _LOGO_MIN_HEIGHT) ? _LOGO_MIN_HEIGHT : null;
$max_width = (defined('_IMG_MAX_WIDTH') and _IMG_MAX_WIDTH) ? _IMG_MAX_WIDTH : null; }
$max_height = (defined('_IMG_MAX_HEIGHT') and _IMG_MAX_HEIGHT) ? _IMG_MAX_HEIGHT : null; else {
$min_width = (defined('_IMG_MIN_WIDTH') and _IMG_MIN_WIDTH) ? _IMG_MIN_WIDTH : null; $max_width = (defined('_IMG_MAX_WIDTH') and _IMG_MAX_WIDTH) ? _IMG_MAX_WIDTH : null;
$min_height = (defined('_IMG_MIN_HEIGHT') and _IMG_MIN_HEIGHT) ? _IMG_MIN_HEIGHT : null; $max_height = (defined('_IMG_MAX_HEIGHT') and _IMG_MAX_HEIGHT) ? _IMG_MAX_HEIGHT : null;
} $min_width = (defined('_IMG_MIN_WIDTH') and _IMG_MIN_WIDTH) ? _IMG_MIN_WIDTH : null;
$min_height = (defined('_IMG_MIN_HEIGHT') and _IMG_MIN_HEIGHT) ? _IMG_MIN_HEIGHT : null;
}
$res = medias_verifier_largeur_hauteur_image($infos, $max_width, $max_height, $min_width, $min_height); $res = medias_verifier_largeur_hauteur_image($infos, $max_width, $max_height, $min_width, $min_height);
if ($res !== true) { if ($res !== true) {
return $res; return $res;
}
} }
if ($is_logo) { if ($is_logo) {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter