![ישן](https://static.fresh.co.il/images/vBulletin/statusicon/post_old.gif)
01-03-2005, 12:17
|
![צלמית המשתמש של ryan ariel levi](image.php?u=40044&dateline=1098821864) |
|
|
חבר מתאריך: 06.10.04
הודעות: 1,337
|
|
בכל מקרה
סליחה שאני מציק ![Big Grin](images/smilies/biggrin.gif)
אבל זה דוגמא לקוד לטעינת קובץ תמונה ושמירתו באותו שם (עולה על הקובץ הקיים) רק בהקטנה
לגודל של 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.
סיבה: היו כמה שורות מיותרות...
|