note 46591 added to function.imagejpeg
| From: | dot) | Date: | Sat, 16 Oct 2004 12:50:40 +0000 |
| Subject: | note 46591 added to function.imagejpeg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78658@lists.php.net to get a copy of this message | ||
I have a problem with imagejpeg() function:
This works:
<?php
$original = imagecreatefromjpeg("makro_1.jpg");
$small = imagecreatetruecolor(160, 120);
imagecopyresampled($small, $original, 0, 0, 0, 0, 160, 120, 1600, 1200);
header("Content-type: image/jpeg");
imagejpeg($small);
?>
and this doesn't:
<?php
$original = imagecreatefromjpeg("makro_1.jpg");
$small = imagecreatetruecolor(160, 120);
imagecopyresampled($small, $original, 0, 0, 0, 0, 160, 120, 1600, 1200);
$thumb = "tn.jpg";
imagejpeg($small, $thumb);
echo '<img src="' . $thumb . '">';
?>
Browser shows just a place for an image (because of <img> tag) with a red cross inside,
beacuse the image wasn't found. Are images saved to a file by imagejpeg() function saved
permanently or just temporarily? And where? Thanks... SQ
----
Manual Page -- http://www.php.net/manual/en/function.imagejpeg.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46591
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46591&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46591&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46591&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46591&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46591&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46591&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46591&report=yes
Search -- http://master.php.net/manage/user-notes.php