note 103826 added to function.imagejpeg
| From: | bernytech at gmail dot com | Date: | Thu, 05 May 2011 10:32:22 +0000 |
| Subject: | note 103826 added to function.imagejpeg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-179449@lists.php.net to get a copy of this message | ||
Don't be like me racking my brain for hours trying to figure out why my xxx.php file outputs http://localhost/xxx.php as a one line response.
Why?
Most likely, you have either:
1. whitespaces before or after the php tags
2. need to set header('Content-type: image/jpeg');
3. if you have required files...be sure nothing is outputted...no test print statements because page
expects image information
4. there is an error in your code
in my case, it was 4. there is a reason why the function call base64decode does not work...
it's actually: base64_decode()
by the way, other ways to validate your image encoded in base64 is to use the following tag:
echo '<img src="data:image/jpeg;base64,'.$row['IMAGE'].'"
alt="photo">';
I was pulling a blob encoded base 64 data from mysql database and trying to render it on a page
hope this helps someone.
----
Server IP: 192.41.42.26
Probable Submitter: 99.24.221.175
----
Manual Page -- http://www.php.net/manual/en/function.imagejpeg.php
Edit -- https://master.php.net/note/edit/103826
Del: integrated -- https://master.php.net/note/delete/103826/integrated
Del: useless -- https://master.php.net/note/delete/103826/useless
Del: bad code -- https://master.php.net/note/delete/103826/bad+code
Del: spam -- https://master.php.net/note/delete/103826/spam
Del: non-english -- https://master.php.net/note/delete/103826/non-english
Del: in docs -- https://master.php.net/note/delete/103826/in+docs
Del: other reasons-- https://master.php.net/note/delete/103826
Reject -- https://master.php.net/note/reject/103826
Search -- https://master.php.net/manage/user-notes.php