Unlimited Usenet
day retention, 99% Completion, Unlimited Access, Free Trial!

imagejpeg generating string not image even with header("Content-type:image/jpeg")

This is a discussion on imagejpeg generating string not image even with header("Content-type:image/jpeg") within the PHP Language forums, part of the PHP Programming Forums category; Jerry Stuckle wrote: > cman wrote: > > you can access it at: > > www.marketopp.com/test.php &...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #21 (permalink)  
Old 03-03-2006
jshanman
 
Posts: n/a
Default Re: imagejpeg generating string not image even with header("Content-type:image/jpeg")

Jerry Stuckle wrote:
> cman wrote:
> > you can access it at:
> > www.marketopp.com/test.php
> >
> > the thing is i don't get any errors the source only contains 'ÿØÿà'
> >

>
> OK, here's the header I get from your page:
>
>
> HTTP/1.x 200 OK
> Date: Fri, 03 Mar 2006 03:36:23 GMT
> Server: Apache
> X-Powered-By: ModLayout/3.2.1
> Cache-Control: no-cache
> Keep-Alive: timeout=15, max=98
> Connection: Keep-Alive
> Transfer-Encoding: chunked
> Content-Type: text/html
>
> Note the content-type.
>
> Either you have something causing the headers to be sent prematurely
> (i.e. even a blank line or a space before the first '<') or you're
> getting an error somewhere and not telling us.
>
> What does phpinfo() show about error reporting?
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstucklex@attglobal.net
> ==================



> X-Powered-By: ModLayout/3.2.1


Could it possibly be this:
http://tangent.org/index.pl?lastnode_id=41&node_id=449
It sounds like ModLayout may be sending premature headers. Can you
disable this in your apache config and test?

> Copied from a forum on this page : http://gallery.menalto.com/node/21768

FAQ entry: Apache ModLayout

If you use mod_layout with Apache, make sure it is disabled for gallery
files. Gallery sometimes sends binary data back from a php file, so
adding a header or footer to these requests will corrupt the data!

After adding the following lines to your apache config, it should work:

----------------------------------------------------
# Disable layout header and footer for Gallery2
LayoutIgnoreHeaderURI /path/to/gallery2/*.*
LayoutIgnoreFooterURI /path/to/gallery2/*.*

# PHP Gallery2 overide Layout
<Directory /path/to/gallery2/>
LayoutHeaderOff
LayoutFooterOff
</Directory>


- JS
http://www.endeavorpub.com/

Reply With Quote
  #22 (permalink)  
Old 03-04-2006
cman
 
Posts: n/a
Default Re: imagejpeg generating string not image even with header("Content-type:image/jpeg")

PROBLEM SOLVED!

Thanks guys for all your help to get to the bottom of it.

The problem was in fact because of APACHE MODLAYOUT which corrupted the
outputed image by redisplaying the page as text.

cheers!
-ca

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 08:29 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0