Re: [nyphp-talk] Image resizing/cropping on the fly

2011-09-07 Thread Federico Ulfo
Checked the spacing and try the output buffering, the problem of the header is into PHP, is not the browser that change the headers. The weirdest thing is that the script works fine, but randomly doesn't, that's why I can't really reproduce the problem, but I've to wait that happen, I might send yo

[nyphp-talk] Running multiple mod_php extensions

2011-09-07 Thread Gary Mort
One problem I've run into with using FastCGI for multiple PHP versions is that a number of open source projects depend on mod_php - and while it is possible to reconfigure fastcgi to provide the information that mod_php provided[for example, the script_name defaults to the script name of the fa

Re: [nyphp-talk] Image resizing/cropping on the fly

2011-09-07 Thread Jake McGraw
Maybe try output buffering? Something is generating an error then... On Wed, Sep 7, 2011 at 12:54 PM, Federico Ulfo wrote: > True that, but the error happen randomly, the same image sometimes works > sometimes no, so I think it might be some GD library bug > > > > -- > Federico Ulfo »

Re: [nyphp-talk] Image resizing/cropping on the fly

2011-09-07 Thread Bulat Shakirzyanov
make sure that there is no whitespace between the colon and the header name, so header('Content-type :image/jpeg'); must become header('Content-type: image/jpeg'); I am not sure how sensitive the browsers are to this, but that's how it should be formatted according to the HTTP spec. Additional

Re: [nyphp-talk] Image resizing/cropping on the fly

2011-09-07 Thread Federico Ulfo
True that, but the error happen randomly, the same image sometimes works sometimes no, so I think it might be some GD library bug -- Federico Ulfo » Certified Developer Google & PHP On Wed, Sep 7, 2011 at 12:43 PM, Jake McGraw wro

Re: [nyphp-talk] Image resizing/cropping on the fly

2011-09-07 Thread Jake McGraw
If any of the following causes an error and display_errors == 1, you'll get output and PHP will default to text/html: header('Content-type :image/jpeg'); header('Content-Length: ' . filesize( $image ) ); $file = file_get_contents( $image ); If you have any whitespace prior to header(), you'll ge

[nyphp-talk] Image resizing/cropping on the fly

2011-09-07 Thread Federico Ulfo
Hi guys, I recently experienced an issue with the image resizing on the fly with GD library of PHP. I draw the image with: header('Content-type :image/jpeg'); header('Content-Length: ' . filesize( $image ) ); $file = file_get_contents( $image ); echo $file; it works when the image is already cach