note 42139 deleted from function.imagejpeg by cmb

From: Date: Tue, 04 Oct 2016 15:08:27 +0000
Subject: note 42139 deleted from function.imagejpeg by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-206743@lists.php.net to get a copy of this message
Note Submitter: jannehonkonen at hotmail dot com ---- 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.

« previous php.notes (#206743) next »