Happy Pixels

Florian Loretan's blog on Drupal, creativity and more

images

It is a well known fact that pages with many images load more slowly than simple HTML pages. Not only are image files heavier than text files, they also require additional HTTP requests.

In an attempt to solve both of these performance problems, I have created a new Drupal module: Imagilicious. Imagilicious replaces tags that reference an external image to be loaded with a 100% HTML rendering of the same image. Unlike immature technologies like the <canvas> element, Immagilicious uses tables, which guarantee compatibility even with the most outdated browsers.

Here is a sample of the output (no <img> is used, this is a table), using Wunderkraut's logo as a source image:

I was recently faced with the same problem in two different projects: forcing the creation of an image derivative with imagecache so that it is available in the submit handler of the same form in which the image was uploaded. By default, imagecache generates images on demand triggered by an HTTP request, which is ideal for most cases. However, this design doesn't make it possible to trigger the generation of images programmatically, which is why I created the following code snippet.

Subscribe to images