I have an image script I have been using successfully for some years on one server. The full version actually extracts the image address from a database and writes a watermark on the image. The script is called as an <img src by another page.
On a second site on another server it delivered gibberish as though "header" command not set. I was able to resolve this by using "while (@ob_end_clean());" before the header command.
For another website I am helping to rebuild, the same problem has arisen - but the cure doesn't work!
I have reduced the code to an irreducible minimum just in case a problem lurked elsewhere in the script but the error is repeated.
The garbage output is the typical "�����JFIF���������>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality
���C�
$.' ",#(7),01444'9=82<.342���C
2!!22222222222222222222222222222222222222222222222222�����"��������������
4. �������}�!1AQa"q2���#B��R��$3br�
The basic code (which works on other servers) between the php tags is:-
1. $image=ImageCreateFromJpeg("20090312wart019001.jpg");
2. while (@ob_end_clean());
3. header('Content-Type: image/jpeg');
4. imagejpeg($image);
No spaces, returns etc before or after
This has got me totally beat - any assistance much appreciated. You can access the file at
http://www.wartsoc.co.uk/gallery/image.phpThanks again
Iowarth