Delivering Images to Mobile Devices

Events happening in the community are now at Drupal community events on www.drupal.org.
lukas.white's picture

I'm firmly in the camp that believes media queries and CSS shouldn't be relied upon to resize images for mobile websites, so I've been looking at other approaches - when adapting an existing site for mobile devices - for resizing images server-side.

I've come up with a few ideas, and wanted to gather people's opinions or ideas - and also discuss how, if this is a good approach, it could be best utilised.

One simple solution I came up with involves a simple module I was thinking of putting together (and will, if my approach receives support) which does this:

  1. Upon installation, takes each of your imagecache presets and creates new ones based on those, but optimised for mobile device(s). For example bigimage becomes bigimage_mobile.

  2. In a mobile theme or the module, I implement theme_imagecache which simply replaces bigimage with bigimage_mobile

  3. Optionally checks the existence of the preset first (though performance might well be impaired)

  4. Optionally allows presets to be linked manually

Along the same lines; suppose a blog post contains inline images. I could implement an input filter or post-process output in some way in the mobile context, examine the images and inject an imagecache call where appropriate.

(Note that I'm talking about imagecache in a D6 context, but of course the same principle could be achieved using D7's adopted version of this module)

Any thoughts? Am I re-inventing the wheel, or barking up the wrong tree?

Comments

Great

lewisnyman's picture

I definitely think there needs to be a imagecache extention but I don't think it should be either mobile or desktop.

It would be more effective to have it dependent on screen resolution.

I am thinking a simple configuration page that allows you to add conditions similar to media queries, a minimum and a maximum resolution and then the related image cache.

I suppose you would need to pick a preset or 'image style' to replace. Maybe this should be within the preset itself?

Mobile

Group organizers

Group categories

Mobile

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: