28-11-2004, 23:31
|
|
|
חבר מתאריך: 27.11.04
הודעות: 4
|
|
קוד PHP:
<?php // File and new size $filename = 'test.jpg'; $percent = 100; // Get new sizes list($width, $height) = getimagesize($filename); $percent2 = $height / $percent; $newwidth = $width / $percent2 ; $newheight = $percent; // Load $thumb = imagecreate($newwidth, $newheight); $source = imagecreatefromjpeg($filename); // Resize imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); // Output $newfile = "thumbnails/thumby9j3.jpg"; imagejpeg($thumb,$newfile,'60'); ?>
imagecopyresized
imagejpeg
|