note 42139 added to function.imagejpeg
| From: | jannehonkonenathotmaildotcom at rn2 dot php dot net | Date: | Wed, 05 May 2004 02:44:01 +0000 |
| Subject: | note 42139 added to function.imagejpeg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69218@lists.php.net to get a copy of this message | ||
I had problem wanting to insert stealth - copyrights into images. I could have done this easily with
fopen and such, but I still wanted to use imagejpeg(); and it's quality feature. Well this is
one kind of solution what I discovered, and seems to work fine.
--code--
$filename = "http://www.domain.com/something.jpg";
$im = imagecreatefromjpeg($filename);
imagejpeg($im,$ModImg,65);
$ModImg .= "This is the text added after EOF of the jpeg";
echo $ModImg;
--code--
As imagejpeg(); inserts imagedata into $ModImg, it does not show the image, but it seems to send
headers in that point, so header(); is not needed before echoing variable. Text is viewable with
Hex-editors etc.
----
Manual Page -- http://www.php.net/manual/en/function.imagejpeg.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42139
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42139&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42139&report=yes
Search -- http://master.php.net/manage/user-notes.php