PHP Snippets

How to check if an image is portrait or landscape using PHP

$size = getimagesize($filename); 
$width = $size[0]; 
$height = $size[1]; 
$aspect = $height / $width; 
if ($aspect >= 1) $mode = "vertical"; 
else $mode = "horizontal";  

 

Post A Comment

Anti-Spam Quiz: