Para listar los harchivos de un directório:
Código PHP:
<?
$dir = opendir(".");
while ($file = readdir($dir)) {
echo "<a href=\"$file\"><img src=\"thumb.php?ruta=$file&ancho=30&alto=30\"</a><br>";
}
closedir($dir);
?>
Luego para hacer el thumbnail (thumb.php):
Código PHP:
<?php
$fuente = @imagecreatefromgif($ruta);
$imgAncho = imagesx ($fuente);
$imgAlto =imagesy($fuente);
$imagen = ImageCreate($ancho,$alto);
ImageCopyResized($imagen,$fuente,0,0,0,0,$ancho,$alto,$imgAncho,$imgAlto);
Header("Content-type: image/gif");
imageGif($imagen);
?>