ted_chou12 Posted February 3, 2007 Share Posted February 3, 2007 No matter how hard i tried, getimagesize cannot get the width and height of a foreign image outside my server, can anyone suggest me anyway that I can get those information? because I really need them to restrict the image size, what I have for my own server images is this: <?php $imgsize = getimagesize($imageurl); $width = $imgsize[0]; $height = $imgsize[1]; while ($width > 400 or $height > 120) {$width = $width/1.2; $height = $height/1.2;} ?> in this way, php ensures the image width is less than 400 and height is less than 120 before display, however, if this is not done, the page will look very messy... Thanks Ted Link to comment https://forums.phpfreaks.com/topic/36930-about-getimagesize/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.