httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Barry Boyce" <>
Subject [users@httpd] mod_ext_filter And ImageMagick Proxy
Date Thu, 02 Mar 2006 15:02:12 GMT
Hey, I've been trying lately to get a forward proxy to recompress
images on-the-fly using mod_ext_filter and ImageMagicks "convert"
program.  Here is the virtualhost I have set up for it in my
httpd.conf.  I am removing my ip addr:

ExtFilterDefine imagecompress mode=output outtype=image/jpeg
intype=image/jpeg cmd="/usr/bin/convert - -quality 35 -"
servername ipaddr
ProxyRequests On
<Proxy *>
	AuthType Basic
	AuthName "Proxy"
	Require user dbn
	AuthUserFile /var/www/passwd
	Order Deny,Allow
	Allow from All
DeflateMemLevel 8
DeflateCompressionLevel 8
DeflateBufferSize 4000
# SetEnvIfNoCase Request_URI \
#	\.(?:gif|jpe?g|png)$ no-gzip dont-vary
#DeflateFilterNote Input instream
#DeflateFilterNote Output outstream
#DeflateFilterNote Ratio ratio

#LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
#CustomLog logs/deflate_log deflate
#AddOutputFilter DEFLATE html txt shtml php asp pl jsp
#AddOutputFilter imagecompress jpg jpeg
SetOutputFilter imagecompress

# mod_mime directive to set the type of .c
# files to text/c
AddType image/jpeg .jpeg .jpg

Adding the type before the external filter didn't work so AddType is
at the bottom.  It filters out anything but jpg's but when it does the
recompressing it always garbles them or something.  My
webbrowser(firefox) can't display anything for them.  I believe
convert's output is getting cut short or somehow apache is piping it

Converting a jpeg with the command "cat test.jpg | convert - -quality
35 - > test2.jpg" works just fine.

BTW, The deflate was in there originally in there for compressing all
output.  I thought a image compressing add-on would be nice.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message