<?php
if(strpos($_GET['nazwa'], '.jpg') !== FALSE){ $img = imagecreatefromjpeg('./img/big/'.$_GET['nazwa']);
$format = 0;
}elseif(strpos($_GET['nazwa'],'.png') !== FALSE){ $img = imagecreatefrompng('./img/big/'.$_GET['nazwa']);
$format = 1;
}else{
die('Format nieobsługiwany'); }
// Wymiarowanie rysunku
$x = imagesx($img);
$y = imagesy($img);
if($x > $y){
$nx = 200;
$ny = 200 * ($y / $x);
}elseif($x < $y){
$nx = 200 * ($x / $y);
$ny = 200;
}else{
$nx = 200;
$ny = 200;
}
$new_img = imagecreatetruecolor($nx, $ny);
imagecopyresampled($new_img, $img, 0, 0, 0, 0, $nx, $ny, $x, $y);
if($format == 0){
imagejpeg($new_img, './img/small/'.$_GET['nazwa'], 9);
}else{
imagepng($new_img, './img/small/'.$_GET['nazwa']);
}
?>
To jest kod odpowiedzialny za tworzenie miniatury... jak widać jest resampled,więc to nie to.