note 30536 added to function.imagearc
| From: | larzfour at hotmail dot com | Date: | Fri, 21 Mar 2003 07:26:47 +0000 |
| Subject: | note 30536 added to function.imagearc | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45597@lists.php.net to get a copy of this message | ||
I have a problem with getimagesize()
the code is here end the problem is shortly commented
<?php
$path = ".";
$dir_handle = @opendir($path) or die("Couldnt open path - \"$path\"");
while ($file = readdir($dir_handle)){
if($file!='.' && $file!='..' && $file!='index.php'
&& $file!='css.css'){
/*problem is here, it appears that i dont get width nor height of a picture*/
$size = getimagesize($file);
$real_w = $size[0];
$real_h = $size[1];
$one=ceil(intval($real_w / 167));
$two=ceil(intval($real_h / 125));
$new_w=$real_w / $one;
$new_h=$real_h / $two;
echo "".$file."(".$real_w." ".$real_h.")";
//echo "<img src=\"".$path."/".$file."\"
width=\"".$new_w."\" height=\"".$new_h."\"></img>
";
}
else echo"";
}
closedir($dir_handle);
?>
--
http://www.php.net/manual/en/function.imagearc.php
http://master.php.net/manage/user-notes.php?action=edit+30536
http://master.php.net/manage/user-notes.php?action=delete+30536
http://master.php.net/manage/user-notes.php?action=reject+30536