Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Apr 16, 2012

    Now generates Retina images correctly if the required image size was
    larger than the maximum $resolutions value
Commits on Apr 14, 2012
  1. JPGs are now saved as Progressive JPG

    Smaller file-size, faster downloading.
  2. Minor bugfix

    Compatibility with old-style JS snippet
  3. Smarter handling of Retina type displays

    Previous AI behaviour meant that supporting Retina required adding very
    high values in the $resolutions array. This is sub-optimal:
    1) This array is meant to be nothing more than the same values as your
    media query breakpoints. Adding larger ones isn't intuitive.
    2) When no cookie is set, AI sends non-mobile devices the largest
    $resolution value, which in this case could be far too large for most
    AI is now much smarter, you do not need to edit the $resolutions array;
    just leave that as your CSS MQ sizes.
    AI now auto-detects the pixel density of any high DPI device and either
    picks a matching size from the existing array, or creates new high-dpi
    images which are multiples of your chosen $resolutions values.
    NOTE: If you see folders in the ai-cache directory which are *larger*
    than any defined in your $resolutions array, it is because someone with
    a high DPI / Retina display visited your site, and AI was able to
    generate the required image.
Commits on Mar 28, 2012
  1. Updated instructions

Commits on Feb 19, 2012
  1. Improved mobile detection. Better first-run experience

    Better behaviour when cookies are not available.
    Now creates the cache directory itself, making installation a two-step
    1) Put the files on your server
    2) Add one line of JS to the <head> of your HTML
Commits on Feb 17, 2012
  1. @gerv

    Fix browser detection to be more future-proof - check for mobile brow…

    gerv authored
    …sers instead of 'desktop' ones. This does a better job for unusual OSes, tablets etc. "Mobile" is in the UA string of the latest mobile IE, mobile Firefox and all mobile WebKits, but is not in the UA string of Android tablets or desktop browsers.
    If you want to treat Opera Mobile as a mobile browser too, change the detection to "mobi" instead of "mobile".
Commits on Jan 24, 2012
  1. Bugfix

    Eliminated occasional double-slash in $cache_file path due to
    $requested_uri sometimes starting with a /
    Made created directories CHMOD 0755 instead of 0777
Commits on Jan 20, 2012
  1. Bumping the version number

    No actual changes, I'd just forgotten to update the version number in
    the comments last time.
Commits on Nov 21, 2011
  1. Bugfix. Also re-instated $mobile_first as TRUE

    Stupid mistake was causing the browser detect to always return false.
    Now fixed.
    With this update Adaptive Images now detects if a user is running on a
    desktop OS and switches $mobile_first to FALSE in that case. This means
    that _if no cookie is set_ and $mobile_first is TRUE the following will
    On a mobile phone, the mobile sized image will be delivered.
    On a desktop, the highest resolution configured will be delivered.
    If a cookie is set, Adaptive Images will use the cookie value to
    determine the correct size image to send.
Commits on Nov 11, 2011
Commits on Nov 10, 2011
  1. Make $mobile_first safer

    To work around browser issues with unreliable cookie setting speed
    Adaptive Images now also checks the user agent string.
    If a desktop environment is detected, $mobile_first is automatically
    over-ridden to "FALSE". If not Adaptive Images will obey the configured
    This is a safety fallback and requires testing before I revert the
    default $mobile_first configured value to TRUE.
  2. Fix rare GD lib bug

    Fixed an issue where GD was present but did not always have the
    imageconvolution function available.
    Changed $mobile_first default to FALSE to avoid issues with
    unpredictable browser behaviour relating to race conditions between
    cookie setting and image requesting
  3. Various updates

Commits on Oct 26, 2011
  1. @timcooper
  2. @timcooper
Commits on Oct 18, 2011
  1. Stop proxies caching images, stop Firefox and IE experiencing the eff…

    …ects of unfavourable race-condition outcomes.
    Stopped Firefox (and IE) from honouring $mobile_first:
    This is because both suffer from a race condition when setting the
    cookie. Sometimes it's set before <img> are requested, sometimes not.
    This could produce desktop websites with mobile versions on first page
    Changed the HTTP Cache Header from "public" to "private":
    This allows caches that are specific to one user (e.g., browser cache)
    to store the image in cache; shared caches (e.g., a proxy server)
    won't. This should avoid people behind proxies or other caching
    mechanisms experiencing wrongly sized images.
Commits on Sep 23, 2011
  1. removed redundant comment

  2. Fix for IE bug

    IE wasn't setting the cookie properly
Commits on Sep 6, 2011
  1. Added transparency support for .png files

    Luis Escobar Bravo authored
Commits on Sep 4, 2011
  1. Version 1.3 final

    Mobile First is set to TRUE by default (this means if JavaScript is
    unavailable AI will send the smallest version), PHP has been
    re-factored, a change-log has been added (see that for more details)
  2. @Seldaek
  3. @Seldaek
  4. @Seldaek
  5. @Seldaek
  6. @Seldaek
  7. @Seldaek
  8. @Seldaek
  9. @Seldaek

    dl doesn't always exist

    Seldaek authored
  10. @Seldaek

    Set the public directive on the Cache-Control header since this is HT…

    Seldaek authored
    …TP/1.1, Pragma is a hack for very old things. Also fixed maxage to be max-age
  11. @Seldaek

    Strings must be quoted

    Seldaek authored
  12. @Seldaek

    Whitespace/formatting fixes

    Seldaek authored
Commits on Sep 2, 2011
Commits on Sep 1, 2011
  1. Clarified PHP comments

Something went wrong with that request. Please try again.