On-the-fly Image Manipulation



Next: Performance Considerations Up: The Image Delivery Previous: The Image Delivery

On-the-fly Image Manipulation

0.5 The imgshow script generates magnified sub-images by a three stage pipeline, using programs from the NETPBM package:

  1. cut out a rectangular section of the pre-processed image file at the required resolution (pnmcut).
  2. perform colour reduction down to 256 colours or less (ppmquant)
  3. convert the image to the GIF format (ppmtogif)

If the new image is zoomed-in to the extent that the individual pixels in the original image are magnified, then an extra process is inserted after the first stage to scale the image (pnmscale). This extra process can be added to by defining the Perl variable $filter. (We have also experimented with using pnmconvol to apply a smoothing filter to the scaled image.)

Temporary files are created for the sub-images that are generated. Having generated the image file, the imgshow script forks, and the child process waits for a configurable delay and before removing the temporary file. The delay is currently set to five minutes, which should be enough time for the client to request the server to send the image. Once the server has the image file open, it file will continue to exist, even after its directory entry has been removed, until the server closes the file. This technique avoids filling up our disk with temporary files.



Next: Performance Considerations Up: The Image Delivery Previous: The Image Delivery


Andrew Ford (andrew@icarus.demon.co.uk), Sat Sep 17 17:02:30 BST 1994