Code:
<?php
$file = "icon1.jpg";
header('Content-type: image/jpeg');
list($imgw, $imgh) = getimagesize("images/".$file);
$newwidth = $imgw * 0.5;
$newheight = $imgh * 0.5;
// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg("images/".$file);
// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $imgw, $imgh);
copy($thumb,"d:/www/final/".$file);
?>
<?php
$file = "icon1.jpg";
header('Content-type: image/jpeg');
list($imgw, $imgh) = getimagesize("images/".$file);
$newwidth = $imgw * 0.5;
$newheight = $imgh * 0.5;
// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg("images/".$file);
// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $imgw, $imgh);
copy($thumb,"d:/www/final/".$file);
?>
da li kod ima smisla?
da li postoji mogucnost da se pri uploadu, snimi original fajl, i resize-ovan u dva razlichita foldera?!