Proponuję najpierw użyć pola SZUKAJ na forum a później pisanie nowego posta o tym co już było x razy:
imagecreatefromjpeg - skalowaniepliki BMP - skalowanieskalowanie image bez pikselizacji
Skalowanie obrazkowskalowanie zdjecminiatury zdjęćimagecopyresized<?php
// File and new size
$filename = 'test.jpg';
$percent = 0.5;
// Content type
header('Content-type: image/jpeg');
// Get new sizes
$newwidth = $width * $percent;
$newheight = $height * $percent;
// Load
$thumb = imagecreate($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
// Output
imagejpeg($thumb);
?>
imagecopyresampled()<?php
// The file
$filename = 'test.jpg';
// Set a maximum height and width
$width = 200;
$height = 200;
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
if ($width && ($width_orig < $height_orig)) {
$width = ($height / $height_orig) * $width_orig;
} else {
$height = ($width / $width_orig) * $height_orig;
}
// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
// Output
imagejpeg($image_p, null, 100);
?>