
Kod
<?php
$y = 60;
$x = 80;
$ImgSize = getimagesize($img);
$a = $ImgSize[1];
$b = $ImgSize[0];
$SrcImg = imagecreatefromjpeg($img);
$thumb = imagecreatetruecolor($x,$y);
imagecopyresampled($thumb,$SrcImg,0,0,0,0,$x,$y,$b,$a);
imagejpeg($thumb);
return $thumb;
?>
$y = 60;
$x = 80;
$ImgSize = getimagesize($img);
$a = $ImgSize[1];
$b = $ImgSize[0];
$SrcImg = imagecreatefromjpeg($img);
$thumb = imagecreatetruecolor($x,$y);
imagecopyresampled($thumb,$SrcImg,0,0,0,0,$x,$y,$b,$a);
imagejpeg($thumb);
return $thumb;
?>
wszystko działa ładnie i spełnia moje oczekiwania gdy jest to plik jpg,jpeg, ALE

