Changed lines at line 22
22: TODO: describe the CGI interface
23: 1.1.1 Configuration
24: TODO: describe the configuration file syntax and options
25: The request URL is:
26: {code:none}
27: \http://<host>/<path>/imgserv.cgi?src=<image src>&width=<width>&height=<height>
28: {code}
29: Where __<image src>__ is a complete URL or relative path identifier of the image to request. If the normal request URL of an image would be "images/1.jpg" than the __<image src>__ is "images/1.jpg" too. __<width>__ and __<height>__ are integers greater zero and denote the dimension of the requested image in pixel. Other units are not planed.
30: Examples:
31: {code:none}
32: \http://<host>/<path>/imgserv.cgi?src=images/1.jpg&width=800&height=600
33: \http://<host>/<path>/imgserv.cgi?src=http://<otherhost>/album1/slides/image1.jpg&width=800&height=600
34: {code}
35: 1.1.1 Configuration
36: TODO: describe the configuration file syntax and options
37: 1.1 Design
38: 1.1.1 Raster
39: We introduced a raster in which the images are scaled. This prevends the cache of filling up with various fine grained scaled versions of the same image. The raster width is an configuration option which belongs to the caching group.
40: This option must be fixed over an reasonable lifetime of the server. The client shouldn't get different scaled images for the same requested dimension. In particular, the server is not allowed to serve a "good matching" version of an images which is a cache hit.
41: The dimension to serv is calculeted this way:
42: {code:java}
43: /*pseudo java code*/
44: int calcWidth; //bounding box fitting width
45: int calcHeight; //bounding box fitting height
46: int servWidth; //width to serve
47: int servHeight; //height to serve
48: int raster; //width of the raster
49: servWidth = (calcWidth / raster) * raster; //integer division
50: servHeight = (calcHeight / raster) * raster;
51: {code}