mobify/mobifyjs — pull request #159 by jansepar (2013-05-24 01:05:27+00:00)
Title: WEBP support

DO NOT MERGE BULL ASTRONAUT!

This PR is to open a discussion about how we want to add webp detection to Mobify.js. The detection mechanism used by Modernizr seems to work well, but it is async. There are two options we can go with:

1. Default webp to false in the `defaults` object, and do the detection when loading the library, overriding `defaults` if there is support. Since we have to finish capturing before running the `resize` method, the feature detect should be complete by then.
2. Change the `resize` method to be async and do the detection there.

Also please note webp is not live on the image resize service, so this PR will give you broken images :)