In breve il mio problema è questo:
Utilizzando le librerie GD devo confrontare due immagini, e da loro 2 devo prendere le misure (width e height) più piccole.
Il codice che io utilizzo è questo:
E ciò funziona solo se $img1 è minore di $img2, io invece vorrei che funzionasse sempre.Codice PHP:
$img1_s = getimagesize($img1);
$img2_s = getimagesize($img2);
if($img1_s[0] > $img2_s[0]) $width = $img1_s[0];
else $width = $img2_s[0];
if($img1_s[1] > $img2_s[1]) $height = $img1_s[1];
else $height = $img2_s[1];
Capisco di essere poco chiaro, però chiedo a voi dove sta l'errore dato che io non capisco.
Grazie.