Jump to content

about getimagesize()


ted_chou12

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.