01-03-2005, 12:17
|
|
|
|
חבר מתאריך: 06.10.04
הודעות: 1,337
|
|
בכל מקרה
סליחה שאני מציק
אבל זה דוגמא לקוד לטעינת קובץ תמונה ושמירתו באותו שם (עולה על הקובץ הקיים) רק בהקטנה
לגודל של 128 על 128
קוד:
<?php
$newfile = '319.jpg';
// The file
$filename = '319.jpg';
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
list($width, $height) = getimagesize($filename);
$new_width = 128;
$new_height = 128;
// Resample
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
//Overwrite The Image With New Dimensions
imagejpeg($image_p,$newfile);
?>
_____________________________________
נערך לאחרונה ע"י ryan ariel levi בתאריך 01-03-2005 בשעה 12:19.
סיבה: היו כמה שורות מיותרות...
|