mayuresh86 Posted August 20, 2011 Share Posted August 20, 2011 can we limit the image by its resolutin while uploading? i want only 130 by 110 pixel image,or i want to convert uploaded image to 130 by110 size.. can i? lyk by using $_FILES array..? Link to comment https://forums.phpfreaks.com/topic/245282-limit-on-image-that-we-want-to-upload/ Share on other sites More sharing options...
codefossa Posted August 20, 2011 Share Posted August 20, 2011 <?php $img = 'http://www.desiglitters.com/wp-content/uploads/2009/02/dragon-desi-glitters-7.gif'; $maxX = 130; $maxY = 110; list($imgX, $imgY) = getimagesize($img); if ($imgX > $maxX || $imgY > $maxY) { die("Image is too large. ($imgX x $imgY)"); } else { die("Image is small enough. ($imgX x $imgY)"); } ?> Link to comment https://forums.phpfreaks.com/topic/245282-limit-on-image-that-we-want-to-upload/#findComment-1259791 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.