Re: mod_layout and dynamic images

Aaz <[email protected]> Mon, 30 Apr 2007 10:26:27 +0300
Newsgroups gmane.comp.apache.mod-layout
Message-ID <[email protected]>
Hello,

Seems that the following code fixes the problem. It should be added to 
layout_filter function.

if (strstr(r->content_type,"image")!= NULL) {
      return ap_pass_brigade(f->next, b);
};
> Hello,
>
> I'd like to continue discussion about problem described
> here 
> http://lists.tangent.org/pipermail/mod_layout/2007-February/002237.html 
> and here 
> http://lists.tangent.org/pipermail/mod_layout/2004-March/002069.html
>
> The problem is about dynamically changed Content-type header of the 
> output document.
> For example:
> <?php
>     header("Content-Type: image/png");
>     $string = $_GET['text'];
>     $im     = imagecreate(300,300);
>     $orange = imagecolorallocate($im, 220, 210, 60);
>     $px     = (imagesx($im) - 7.5 * strlen($string)) / 2;
>     imagestring($im, 3, $px, 9, $string, $orange);
>     imagepng($im);
>     imagedestroy($im);
> ?>
>
>
> This script shouldnt be processed by mod_layout, but it is.
> I have output_buffering=On in php.ini file, but it doesnt help.
> I cant use LayoutIgnoreURI
>
> I'm using latest apache 2.2 and mod_layout 5.0.
> Is there a way to avoid processing such scripts?
> Maybe there's some workaround about this problem?
> _______________________________________________
> Mod_layout mailing list
> [email protected]
> http://lists.tangent.org/mailman/listinfo/mod_layout
>
>