View Single Post
ישן 04-02-07, 13:26   # 1
dudu
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
גיל: 35
הודעות: 204

dudu לא מחובר  

בעיה עם הקטנת תמונה:

אני מנסה להקטין תמנוה וזה נותן לי שגיאות. אפילו שממש העתקתי אתה קוד מphp.net

הקוד:
PHP קוד:
<?php

$filename
=$_GET["image"];

// Set a maximum height and width
$width 200;
$height 200;

// Content type
header('Content-type: image/jpeg');

// Get new dimensions
list($width_orig$height_orig) = getimagesize($filename);

$ratio_orig $width_orig/$height_orig;

if (
$width/$height $ratio_orig) {
   
$width $height*$ratio_orig;
} else {
   
$height $width/$ratio_orig;
}

// Resample
$image_p imagecreatetruecolor($width$height);
$image imagecreatefromjpeg($filename);
imagecopyresampled($image_p$image0000$width$height$width_orig$height_orig);

// Output
imagejpeg($image_pnull100);
?>
הנה נסיון עם הלוגו של האתר:
http://www.dati-breshet.co.il/upload...hosts/logo.jpg
__________________
  Reply With Quote