[post:507#4976]
Rebecca
04/04/2011 02:35 PM
Reviews: 23
Posts: 772
|
Specifically? No, it's triggered by a rewrite rule (below). This is why if you specify a series id that doesn't exist you will actually get a 404.
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-s
RewriteCond %{DOCUMENT_ROOT}images/series/$3 -s
RewriteRule ^/images/sized/([^/]+)/([^/]+)/(.+)\.([A-Za-z]+)$ /image_manip.cgi?$1,$2,images/series/$3,!resize,$4,images/sized/$1/$2/$3.$4,!store [L,NS]
The first condition says that the file doesn't exist on disk yet. The second says that the series id -does- exist in the raw images folder.
And the finally we rewrite it into arguments for the script. The script uses a little domain specific language to do it's manipulation.
I used to watermark images that were directly linked from other sites (I just refuse those requests now), and I used this mechanism to add the watermark. It's a simple stack based language.
So to resize, given that $1 is the max width, $2 is the max height, $3 is the series id and $4 is the image type (eg, jpg, gif, png, etc):
$1,$2,images/series/$3,!resize,$4,images/sized/$1/$2/$3.$4,!store
And to add a watermark, given the same arguments:
$1,$2,images/series/$3,!resize,!sizeof,leach_trans.png,!resize,SouthWest,!merge,$4,images/sized/leached/$1/$2/$3.$4,!store
Edited
on 04/04/2011 02:36 PM.
|