DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30730>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30730





------- Additional Comments From [EMAIL PROTECTED]  2007-03-13 14:21 -------

With the following configuration, I am able to reproduce the issue :

ExtendedStatus on
 <Location /server-status>
SetHandler server-status

Order Deny,Allow
Deny from all
Allow from all
</Location>


DocumentRoot "/disk/apache/apache2/imgs"

<Location "/">
    AddHandler watermark .jpeg
    Action watermark "/cgi-bin/watermark1.php"
</Location>

For a request e.g /test.jpeg, request is internally redirected.
ap_internal_redirect_handler handles the redirection.
ap_internal_redirect_handler creates a new request_rec. ap_invoke_handler
process the request. In this case jpeg file is sent. The new request_rec
structure contains the bytes sent but the original request's bytes are never
incremented so mod_status doesn't count the bytes sent.



Here is the watermark1.php
-------------------------------------------

#!/opt/php5.2.1/bin/php
<?php

/*
   program:      makeimg.php
   description:  creates new image by merging
                 source image with watermark
                 and outputs it to browser
*/

header("Content-Type: image/jpeg");
//(because the script outputs picture)


print "\r\n";
$transparency = 40; //watermark's transparency (0-100)

//source photo
$source_photo = stripslashes($_ENV{'PATH_TRANSLATED'});
$photo = imagecreatefromjpeg($source_photo);

//watermark
$watermark = imagecreatefrompng('watermark.png');
$watermark_width = imagesx($watermark);
$watermark_height = imagesy($watermark);

//location of the watermark on the source image
$size = getimagesize($source_photo);
$dest_x = ($size[0] - $watermark_width) / 2;
$dest_y = ($size[1] - $watermark_height) / 2;

//make the image (merge source image with watermark)
imagecopymerge($photo, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width,
$watermark_height, $transparency);

//output the image
imagejpeg($photo);

//free memory
imagedestroy($photo);
imagedestroy($watermark);

?>
-------------------------------------------
php shipped with Fedora Core 5 doesn't work correctly.
Also for this script, cgi/php will not work. cli/php will work correctly
because cgi/php will expect script name to be in PATH_TRANSLATED variable.
-------------------------------------------


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to