Code
<?php
$dir="uploads/";
$totalsize = 0;
if (is_dir($dir))
{
$fd = @opendir($dir);
if($fd)
{
while (($part = @readdir($fd)) == true)
{
if ($part != "." && $part != "..")
{
$file_array[]=$part;
}
}
}
for($i=0;$i<count($file_array);$i++)
{
$npart=$file_array[$i];
if (is_file($dir.$npart))
{
$width = imagesx($dir.$npart);
$height = imagesy($dir.$npart);
$scale = min(100/$width, 100/$height);
# If the image is larger than the max shrink it
if ($scale < 1) {
$width = floor($scale*$width);
$height = floor($scale*$height);
}
?>
<td><img src="<?php echo $dir.$npart;?>" height="<?php echo $height;?>" width="<?php echo $width;?>"/></td>
<?php
}
}
}
?>
PHP Version 4.3.2
GD Support enabled
GD Version bundled (2.0.12 compatible)
FreeType Support enabled
FreeType Linkage with freetype
GIF Read Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
Errors
Warning: imagesx(): supplied argument is not a valid Image resource in /var/www/html/restaurant/maintenance/upload2.php on line 125
Warning: imagesy(): supplied argument is not a valid Image resource in /var/www/html/restaurant/maintenance/upload2.php on line 126
Warning: Division by zero in /var/www/html/restaurant/maintenance/upload2.php on line 127
Warning: Division by zero in /var/www/html/restaurant/maintenance/upload2.php on line 127