אני מנסה לקחת תמונה מתיקיה אחת, ליצור אותה מחדש ושלוף אותה בקובץ PHP תחת content-type JEPG, כאילו - תמונה חדשה.
הבעיה היא, שהקוד הבא כותב לי משהו חריג - "Resource id #2"
מישהו יודע מה הבעיה?
PHP קוד:
$image_id = $_GET['name']."jpg";
header("Content-type: image/jpeg") ;
header("Content-Length: ".strlen($_SESSION["file_info"][$image_id]));
$new_image = imagecreatetruecolor(300, 300);
$old_image = imagecreatefromjpeg("upload/{$image_id}");
imagecopyresampled($new_image, $old_image, 0, 0, 0, 0, 300, 300, 700, 700);
imagejpeg($new_image, "upload/{$image_id}");
echo $new_image;
תודה!