This project is read-only.

Image processing

XsltDb provides a jpg.aspx handler that is capable of making thumbnails on-the-fly.

See also mdo:image-size - a very fast image size retrival


  • file – [string] – relative path to the original file
  • p – [1/0] – file is relative to portal home (1) or XsltDbFiles root (0). Default 0
  • w – [int] – width of thumbnail (maximum)
  • h – [int] – height of the thumbnail (maximum)
  • x1, y1, x2, y2 – [int] – cropping area (cropping applies to source image)
  • q – [int] – jpeg quality of the thumbnail
  • f - [string] – output format. can be jpeg, png, tiff, gif, bmp. By default XsltDb uses original extenfion as an image for png and gif. Othrewise jpeg is used.
  • keep – [1/0] – if 1 save thumbnail to disk for future use. Default 1
  • ju – [1/0] – if 1 uploads file without transformation
  • wt – [string] – watermark text
  • wp – [string] – path to watermark picture (relative to portal home)
  • cc – [int] – number of minutes that image must be valid in browser cache
  • headers – [string] – attach a list of headers to HTTP response (header1=value1&header2=value2&...)

jpg.aspx supports the following technologies

  • ETag. XsltDb computes a hash code of the thumbnail it creates and sends it to the browser. When browser sends ETag back, jpg.aspx check if it is not changed and sends back 304 status code (Not Modified). That allows you to reduse traffic significantly without having to cache images in browser for long period of time.
  • Enhanced multithreading. jpg.aspx allows you to cache thumbnails on disk and offers a very good performance together with efficient multithreading. This is very useful for relatively large thumbnail with watermarks. Imagine you have site with 100K visitors per day and you have just uploaded a dozen of new photos. You immediately get hundreds of requests for thumbnails of different sizes. With XsltDb jpg.aspx you can let them be prepared and saved by demand without doing this work in advance on separate server.
  • Transparent GIFs. When using GIF as output format transparency is also supported. As you know GDI+ can't save transparent GIFs so XsltDb applys custom solution for making transparency working properly.
  • Supports both IIS6 and IIS7. All differences are maintained by XsltDb internally.

Starting from XsltDb 2.0.19 mdo:thumbnail just returns jpg.aspx?file=...&w=...&h=...&keep=1

Last edited Jan 7, 2011 at 6:24 PM by findy, version 9


No comments yet.