if( ! isset( $filename ) ){
define( "size" , 400 ) ;
define( "sizeH" , 50 );
define( "colnum" , 1 ) ;
$dir = ($dir)?$dir:"." ;
?>
V-Day Tines -NO DIRECT LINKING- [php]= $dir?>
$dd = opendir($dir) ;
for( $i = 0 ; $filename = readdir($dd) ; ){
if( is_file("$dir/$filename") ){
if( $imgsize = getImagesize("$dir/$filename") ){
$w0 = $imgsize[0] ;
$h0 = $imgsize[1] ;
$imgtype = $imgsize[2] ;
$ratio = $w0 / $h0 ;
if( $ratio > 1 ){
$w1 = size ;
$h1 = ( size * $h0 ) / $w0 ;
}
else{
$w1 = ( size * $w0 ) / $h0 ;
$h1 = sizeH ;
}
$params = sprintf( "filename=$dir/$filename&w0=$w0&h0=$h0&imgtype=$imgtype&h1=%d&w1=%d" , $h1 , $w1 ) ; if( ! ( $i % colnum ) ){
echo "\n
\n" ;
}
?>
">
?= $params ?>"
style="width:= $w1 ?>;height:= $h1 ?>;">
= "$filename:" ?>
= "Width: $w0" ?>
= "Height: $h0" ?>
$i++ ;
}
}
}
?>
|
www.scri8e.com
closedir($dd) ;
}
else{
switch($imgtype){
case 1:
$imgtype = "gif" ;
break;
case 2:
$imgtype = "jpeg" ;
break;
case 3:
$imgtype = "png" ;
break;
default:
break;
}
header("Content-type: image/$imgtype") ;
$tImg = imageCreate( $w1 , $h1 ) ;
$imgOpenFunc = "imageCreateFrom".$imgtype ;
$imgSendFunc = "image".$imgtype ;
$img = $imgOpenFunc("$filename") ;
imageCopyResized( $tImg , $img , 0 , 0 , 0 , 0 , $w1 , $h1 , $w0 , $h0 ) ; imageDestroy($img) ; $imgSendFunc($tImg) ;
}
?>