Witam
robie upload plików graficznych.
dla JPG mam :
if(exif_imagetype($img)==2){
$img1 = imagecreatefromjpeg($img);
$imgdest1 = imagecreatetruecolor($x, $y);
imagecopyresampled($imgdest1, $img1, 0, 0, 0, 0, $x, $y, $width, $height);
imagejpeg($imgdest1,$imgdest);
}
dla GIFów:
if(exif_imagetype($img)==1)
{
$img1 = imagecreatefromgif($img);
$imgdest1 = imagecreate($x, $y);
imagecopyResampled($imgdest1, $img1, 0, 0, 0, 0, $x, $y, $width, $height);
imagegif($imgdest1,$imgdest);
}
problem w tym że JPG zpaisuej dobrze a GIFy (nieruchome) zapisuje z popsutymi kolorami - najgorzej z białym i czarnym