aşağıdaki kodlara gif uzantısını eklemek istiyorum
Kod:
<?php
$dir = "../emlak_resimler/$id/";
function yaz($al,$yeni)
{
$e=explode(".",$al);
$uz=strtolower(end($e));
$dizi=array("jpeg","jpg");
if(in_array($uz,$dizi))
{
list($width, $height) = getimagesize($al);
$image = imagecreatetruecolor(420, 320);
$source = imagecreatefromjpeg($al);
imagecopyresized($image, $source, 0, 0, 0, 0, 420, 320, $width, $height);
imagejpeg($image,$yeni);
$image = imagecreatefromstring(file_get_contents("$al"));
$w = imagesx($image);
$h = imagesy($image);
$watermark = imagecreatefrompng('logo.png');
$ww = imagesx($watermark);
$wh = imagesy($watermark);
imagecopy($image, $watermark, 0, 0, 0, 0, $ww, $wh);
imagejpeg($image,$yeni);
}
}
$dosya = opendir($dir);
while (false !== ($filename = readdir($dosya))) {
$files[] =$filename;
}
$x=1;
$a=count($files);
$sayi=$a-3;
while($x<$a)
{
$ad=$dir.$files[$x];
yaz($ad,$ad);
$x++;
}
?>