Arama butonu
Bu konudaki kullanıcılar: 1 misafir, 1 mobil kullanıcı
2
Cevap
193
Tıklama
0
Öne Çıkarma
..
G
19 yıl
Onbaşı
Konu Sahibi

..

DH forumlarında vakit geçirmekten keyif alıyor gibisin ancak giriş yapmadığını görüyoruz.

Üye olduğunda özel mesaj gönderebilir, beğendiğin konuları favorilerine ekleyip takibe alabilir ve daha önce gezdiğin konulara hızlıca erişebilirsin.

Üye Ol Şimdi Değil





< Bu mesaj bu kişi tarafından değiştirildi Guest-7A42F49E9 -- 10 Ağustos 2009; 14:46:46 >

S
19 yıl
Yüzbaşı

<? 
// Some configuration variables !
$maxWidth = 90;
$maxHeight = 90;
$maxCols = 5;
$webDir = "http://localhost/images/";
$localDir = $_SERVER['DOCUMENT_ROOT']."/images/";

$AutorisedImageType = array ("jpg", "jpeg", "gif", "png");
?>

<center>
<table border='1' cellspacing='5' cellpadding='5' style="border-collapse:collapse; border-style: dotted">
<tr>
<?
// Open localDir
$dh = opendir($localDir);
while (false !== ($filename = readdir($dh))) {
$filesArray[] = $filename;
}

// Display and resize
foreach ($filesArray as $images) {

$ext = substr($images, strpos($images, ".")+1, strlen($images));

if( in_array($ext, $AutorisedImageType) ) {

list($width, $height, $type, $attr) = @getimagesize( $localDir.$images );

$xRatio = $maxWidth / $width;
$yRatio = $maxHeight / $height;

if ( ($width <= $maxWidth) && ($height <= $maxHeight) ) {
$newWidth = $width;
$newHeight = $height;
}
else if (($xRatio * $height) < $maxHeight) {
$newHeight = ceil($xRatio * $height);
$newWidth = $maxWidth;
}
else {
$newWidth = ceil($yRatio * $width);
$newHeight = $maxHeight;
}

if($i == $maxCols) {
echo "</tr><tr>";
$i = 0;
}
echo "<td align='center' valign='bottom' width='$maxWidth' height='$maxHeight'><img src='".$webDir.$images."' width='$newWidth' height='$newHeight'><br /><font style=\"font-family:verdana;font-size:9px;\">$images</font></td>";
$i++;
}
}
?>
</tr>
</table>
</center>


Bu mesaja 1 cevap geldi.
L
19 yıl
Yüzbaşı

quote:

Orjinalden alıntı: SaLVaDoR
<? 
// Some configuration variables !
$maxWidth = 90;
$maxHeight = 90;
$maxCols = 5;
$webDir = "http://localhost/images/";
$localDir = $_SERVER['DOCUMENT_ROOT']."/images/";

$AutorisedImageType = array ("jpg", "jpeg", "gif", "png");
?>

<center>
<table border='1' cellspacing='5' cellpadding='5' style="border-collapse:collapse; border-style: dotted">
<tr>
<?
// Open localDir
$dh = opendir($localDir);
while (false !== ($filename = readdir($dh))) {
$filesArray[] = $filename;
}

// Display and resize
foreach ($filesArray as $images) {

$ext = substr($images, strpos($images, ".")+1, strlen($images));

if( in_array($ext, $AutorisedImageType) ) {

list($width, $height, $type, $attr) = @getimagesize( $localDir.$images );

$xRatio = $maxWidth / $width;
$yRatio = $maxHeight / $height;

if ( ($width <= $maxWidth) && ($height <= $maxHeight) ) {
$newWidth = $width;
$newHeight = $height;
}
else if (($xRatio * $height) < $maxHeight) {
$newHeight = ceil($xRatio * $height);
$newWidth = $maxWidth;
}
else {
$newWidth = ceil($yRatio * $width);
$newHeight = $maxHeight;
}

if($i == $maxCols) {
echo "</tr><tr>";
$i = 0;
}
echo "<td align='center' valign='bottom' width='$maxWidth' height='$maxHeight'><img src='".$webDir.$images."' width='$newWidth' height='$newHeight'><br /><font style=\"font-family:verdana;font-size:9px;\">$images</font></td>";
$i++;
}
}
?>
</tr>
</table>
</center>



Peki resimerin boyutunu küçültürken kalitesini de düşürebilme şansımız var mı?





< Bu mesaj bu kişi tarafından değiştirildi looter -- 2 Mayıs 2006; 12:16:18 >

DH Mobil uygulaması ile devam edin. Mobil tarayıcınız ile mümkün olanların yanı sıra, birçok yeni ve faydalı özelliğe erişin. Gizle ve güncelleme çıkana kadar tekrar gösterme.