diff --git a/.DS_Store b/.DS_Store
deleted file mode 100644
index 5008ddf..0000000
Binary files a/.DS_Store and /dev/null differ
diff --git a/.htaccess b/.htaccess
deleted file mode 100644
index 19be14d..0000000
--- a/.htaccess
+++ /dev/null
@@ -1,22 +0,0 @@
-s. For more information visit
- http://blog.yoav.ws/2011/09/Preloaders-cookies-and-race-conditions
-
-version 1.3.3 (2011/10/18) ------------------------------------------------------------
-
- BUG FIXES
- * Added Gecko to the auto-disabled $mobile_first check: IE and Firefox don't
- honour $mobile_first.
-
- This is because both suffer from a race condition when setting the cookie.
- Sometimes it's set before
are requested, sometimes not. This could produce
- desktop websites with mobile versions on first page load.
-
- OTHER IMPROVEMENTS
- * 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.
-
-version 1.3.2 (2011/09/06) ------------------------------------------------------------
- Thanks to Oncle Tom
-
- BUG FIXES
- * Internet Explorer was not correctly setting the cookie, and thus breaking badly
- * Fixed a possible Cookie Injection, and optimised ai-cookie.php
-
- NOTES
- In testing it seems that Firefox is now behaving properly and setting the cookie
- in time. Thus, I've re-instated support for $mobile_first = TRUE on that browser
-
-version 1.3.1 (2011/09/06) ------------------------------------------------------------
- Thanks to Emilio Bravo
-
- BUG FIXES
- * PNGs now maintain their alpha transparency when scaled down (previously got
- black backgrounds where transparency should be)
-
-version 1.3 (2011/09/04) --------------------------------------------------------------
- Huge thanks to Jordi Boggiano
-
- NEW FEATURES
- * Finalised $mobile_first behaviour and defaulted it to TRUE
- BUG FIXES
- * Fixed typo which incorrectly set browser cache
- OTHER IMPROVEMENTS
- * When $mobile_first is FALSE now sends highest configured size instead of original
- * Refactored the PHP to be more robust and efficient
- * Simplified the JS to a single line and fixed pollution of the global namespace
- * Made the .htaccess rule more robust and accurate
-
- NOTES
- Firefox will not honour $mobile_first as set in the CONFIG section. This is
- intentional, and required due to a defect in Firefox's behaviour. It does not set
- cookies fast enough, and therefor on the first visit to a site would load the
- mobile sized image even if JS was enabled. Therefor, AI will not honour the
- $mobile_first setting on Firefox based browsers that have JavaScript disabled.
-
-version 1.3 beta (2011/08/31) ---------------------------------------------------------
-
- NEW FEATURES
- * Added support for Mobile First philosophy (see CONFIG, $mobile_first)
-
- NOTES
- When $mobile_first is set to TRUE it means the mobile sized version of the requested
- image will be sent in the event that no cookie is set (likely because JavaScript is
- unavailable). If FALSE, the original image is sent.
-
- There is a known problem with Firefox on a first visit to a site where $mobile_first
- is TRUE. It doesn't set the cookie fast enough, so the very first load sends the mobile
- size image. All page loads after are fine. Opera, Safari, and Chrome all work OK.
-
-version 1.2.2 (2011/08/30) ------------------------------------------------------------
- NEW FEATURES
- * Unsupported no-javascript solution (see instructions.htm)
-
-version 1.2.1 (2011/08/26) ------------------------------------------------------------
- NO NEW FEATURES
- I have re-branded Responsive-Images to "Adaptive-Images", firstly to help distinguish
- this project from the identically named project by Filament Group, and secondly
- because it's a more appropriate name. This system actively adapts existing images as
- well as "responding" to the visitors viewport to serve an appropriately sized version.
-
- NOTES
- The project is now available on GitHub for those who wish to track it there:
- https://github.com/MattWilcox/Adaptive-Images
-
-version 1.2 (2011/08/21) ------------------------------------------------------------
- Contributions by Fabian Beiner, with thanks :)
- NEW FEATURES
- * Support for PNG and GIF images
- * Added ability to sharpen re-scaled images (see CONFIG, $sharpen)
- BUG FIXES
- * Better extension detection (.jpeg was failing)
- * First-run Firefox bug fixed. The JS must be in-line, in the
Copy adaptive-images.php
and .htaccess
into the root directory of your site. If you already have a htaccess file DO NOT OVERWRITE IT, skip down to the advanced instructions.
Copy the following Javascript into the <head> of your site. It MUST go in the head as the first bit of JS, before any other JS. This is because it needs to work as soon as possible, any delay wil have adverse effects.
-<script>document.cookie='resolution='+Math.max(screen.width,screen.height)+'; path=/';</script>
- That's it, you're done. You should proberbly configure some preferences though.
-NOTE 1: if you would like to take advantage of high-pixel density devices such as the iPhone4 or iPad3 Retina display you can use the following JavaScript instead. - It will send higher-resolution images to such devices - be aware this will mean slower downloads for Retina users, but better images.
-<script>document.cookie='resolution='+Math.max(screen.width,screen.height)+("devicePixelRatio" in window ? ","+devicePixelRatio : ",1")+'; path=/';</script>
- NOTE 2: you do not need the ai-cookie.php
file unless you are using the alternate method of detecting the users screen size. So delete it if you like, no one likes mess.
NOTE 3: If you are extra paranoid about security you can have the ai-cache directory sit outside of your web-root so it's not publicly accessible. Just set the paths properly in the .htaccess file and the .php file.
- -I strongly advise you to duplicate that file so you can revert to it if things go pear-shaped.
-Open your existing .htaccess file and edit the contents. You'll need to look and see if there is a section that begins with the following:
-<IfModule mod_rewrite.c>
If there is, then you need to add the following lines into that block:
- -# Adaptive-Images -----------------------------------------------------------------------------------
-
-# Add any directories you wish to omit from the Adaptive-Images process on a new line, as follows:
-# RewriteCond %{REQUEST_URI} !some-directory
-# RewriteCond %{REQUEST_URI} !another-directory
-
-RewriteCond %{REQUEST_URI} !assets
-
-# Send any GIF, JPG, or PNG request that IS NOT stored inside one of the above directories
-# to adaptive-images.php so we can select appropriately sized versions
-RewriteRule \.(?:jpe?g|gif|png)$ adaptive-images.php
-
-# END Adaptive-Images -------------------------------------------------------------------------------
-
-If you don't have a code block then simply copy and paste the following into your file instead:
- -<IfModule mod_rewrite.c>
- Options +FollowSymlinks
- RewriteEngine On
-
- # Adaptive-Images -----------------------------------------------------------------------------------
-
- # Add any directories you wish to omit from the Adaptive-Images process on a new line, as follows:
- # RewriteCond %{REQUEST_URI} !some-directory
- # RewriteCond %{REQUEST_URI} !another-directory
-
- RewriteCond %{REQUEST_URI} !assets
-
- # Send any GIF, JPG, or PNG request that IS NOT stored inside one of the above directories
- # to adaptive-images.php so we can select appropriately sized versions
- RewriteRule \.(?:jpe?g|gif|png)$ adaptive-images.php
-
- # END Adaptive-Images -------------------------------------------------------------------------------
-</IfModule>
-
- Instructions are in the file as comments (any line that starts with a # is a comment, and doesn't actually do anything)
-Follow the instructions inside that code to specify any directories you don't want to use Adaptive-Images on.
- -You can now open the php file and have a play with the settings that are in the CONFIG area. By default it looks like this:
- -/* CONFIG ----------------------------------------------------------------------------------------------------------- */
-
-$resolutions = array(1382, 992, 768, 480); // the resolution break-points to use (screen widths, in pixels)
-$cache_path = "ai-cache"; // where to store the generated re-sized images. Specify from your document root!
-$jpg_quality = 80; // the quality of any generated JPGs on a scale of 0 to 100
-$sharpen = TRUE; // Shrinking images can blur details, perform a sharpen on re-scaled images?
-$watch_cache = TRUE; // check that the adapted image isn't stale (ensures updated source images are re-cached)
-$browser_cache = 60*60*24*7; // How long the BROWSER cache should last (seconds, minutes, hours, days. 7days by default)
-
-/* END CONFIG ----------------------------------------------------------------------------------------------------------
------------------------- Don't edit anything after this line unless you know what you're doing -------------------------
---------------------------------------------------------------------------------------------------------------------- */
- $resolutions
are the screen widths we'll work with. In the default it will store a re-sized image for large screens, normal screens, tablets, phones, and tiny phones.
In general, if you're using a responsive design in CSS, these breakpoints will be exactly the same as the ones you use in your media queries.
-$cache_path
If you don't like the cached images being written to that folder, you can put it somewhere else. Just put the path to the folder here and make sure you create it on the server if for some reason that couldn't be done autmoatically by adaptive-images.php.
$sharpen
Will perform a subtle sharpening on the rescaled images. Usually this is fine, but you may want to turn it off if your server is very very busy.
$watch_cache
If your server gets very busy it may help performance to turn this to FALSE. It will mean however that you will have to manually clear out the cache directory if you change a resource file
One of the weaknesses of the Adaptive Images process is its reliance on JavaScript to detect the visitors screen size, and set a cookie with that screen size inside it. The following is a solution for people who need the system to work without the use of JavaScript, but it does have a major caveat which is why this is not the default method, and why it is "unsupported" (I'm not going to troubleshoot problems you have with this method).
- -Do not use the JavaScript as explained above, but instead, ABOVE your normal CSS, add the following into the head:
-<style>
- @media only screen and (max-device-width: 479px) {
- html { background-image:url(ai-cookie.php?maxwidth=479); } }
- @media only screen and (min-device-width: 480px) and (max-device-width: 767px) {
- html { background-image:url(ai-cookie.php?maxwidth=767); } }
- @media only screen and (min-device-width: 768px) and (max-device-width: 991px) {
- html { background-image:url(ai-cookie.php?maxwidth=991); } }
- @media only screen and (min-device-width: 992px) and (max-device-width: 1381px) {
- html { background-image:url(ai-cookie.php?maxwidth=1381); } }
- @media only screen and (min-device-width: 1382px) {
- html { background-image:url(ai-cookie.php?maxwidth=unknown); } }
-</style>
-If you use this method you will need to ensure the widths here match those in your adaptive-images.php file, you will also need to have the ai-cookie.php
file in the root of your website (no one else needs this file).
Using this method instead of the JS method makes it likely that on the very first visit to your site, the images sent to the visitor will be the original full-scale versions. However, ALL subsequent pages on your site will work properly. What that means is that, really, this solution is only viable if you've got $mobile_first set to FALSE. Otherwise, the majority of people who visit your site will experience images too small for their computer on the very first visit.
-The reason is to do with how browsers load web pages. The first thing a browser does is load the HTML, in the order it's written - so for a normal AI install it loads the HTML and see's the embeded JavaScript and immediately executes that JavaScript - which writes the cookie. It then carries on loading the rest of the page in the order it finds it. Long story short - it means that when it finds an image tag and asks the server for it, it already has a cookie stored.
-That's not likely to be the case if you use the CSS method. Because the CSS method relies on an external file - it has to ask the server for the "background-image", which is really just a bit of PHP to set a cookie. The problem is that when a browser loads external files like that, it doesn't stop loading the HTML, it carries on doing that at the same time as waiting for the external file. Which means that it can get to an image tag before the server has finished loading that PHP file. This is only an issue on the very first page load, and AI has smart fallbacks to deal with a no-cookie situation.
- -Most of the time people report problems it is due to one of two things:
-If images vanish, there is something wrong with your .htaccess configuration. This happens mostly on WordPress sites - it's because the server, and wordpress, have specific requirements that are different from most servers. You'll have to play about in the .htaccess file and read up on how to use ModRewrite.
-If you're seeing error images (big black ones) That's AI working, so your .htaccess is fine. Read the messages on the image. Most of the time you'll only see this problem because your server requires less strict permissions to write to the disc. Try setting the ai-cache directory to 775, and if all else fails use 777 - but be aware this is not very secure if you're on a shared server, and you ought to instead contact your administrator to get the server set up properly.
- - \ No newline at end of file diff --git a/instructions_de.htm b/instructions_de.htm deleted file mode 100644 index e216fd1..0000000 --- a/instructions_de.htm +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - -Kopieren Sie adaptive-images.php
und .htaccess
- in das Hauptverzeichniss ihres Internetauftritts.
- Wenn Sie bereits eine htaccess Datei haben BITTE NICHT ÜBERSCHREIBEN, lesen sie die dafür vorgesehenen Instruktionen.
Erstellen Sie ein Verzeichniss mit dem Namen ai-cache
im Hauptverzeichniss
- mit Schreibberechtigung (CHMOD 777).
Kopieren Sie folgendes Javascript in den <head> Bereich ihrer Seiten. - Das Script MUSS sich im head Bereich befinden damit es ausgeführt wird bevor - die gesamte Seite geladen ist und die ersten Bilder vom Server ausgeliefert werden.
-<script>document.cookie='resolution='+Math.max(screen.width,
-screen.height)+'; path=/';</script>
- Das wars. Sie sind fertig
-ANMERKUNG: Die ai-cookie.php
Datei wird normalerweise nicht
- benötigt. Nur beim Einsatz der Alternativen Methode
- zum Feststellen der Displaygrösse wird sie benötigt ansonsten kann sie gelöscht werden.
Sichern Sie bitte diese Datei bevor Sie Änderungen daran vornehmen.
-Öffnen Sie bitte ihre bestehende .htaccess Datei und editieren Sie den Inhalt. - Suchen Sie nach einem Abschnitt suchen der so beginnt:
-<IfModule mod_rewrite.c>
Sollten Sie ihn gefunden haben kopieren Sie folgenden Code in den Bereich:
- -# Adaptive-Images -----------------------------------------------------------------------------------
-
-# Add any directories you wish to omit from the Adaptive-Images process on a new
-line, as follows:
-# RewriteCond %{REQUEST_URI} !some-directory
-# RewriteCond %{REQUEST_URI} !another-directory
-
-RewriteCond %{REQUEST_URI} !assets
-
-# Send any GIF, JPG, or PNG request that IS NOT stored inside one of the above
-directories
-# to adaptive-images.php so we can select appropriately sized versions
-RewriteRule \.(?:jpe?g|gif|png)$ adaptive-images.php
-
-# END Adaptive-Images -------------------------------------------------------------------------------
-
-Gibt es keinen solchen Abschnitt in ihrer Datei kopieren Sie stattdesen folgenden Code in die Datei:
- -<IfModule mod_rewrite.c>
- Options +FollowSymlinks
- RewriteEngine On
-
- # Adaptive-Images -----------------------------------------------------------------------------------
-
- # Add any directories you wish to omit from the Adaptive-Images process on a
- new line, as follows:
- # RewriteCond %{REQUEST_URI} !some-directory
- # RewriteCond %{REQUEST_URI} !another-directory
-
- RewriteCond %{REQUEST_URI} !assets
-
- # Send any GIF, JPG, or PNG request that IS NOT stored inside one of the above
- directories
- # to adaptive-images.php so we can select appropriately sized versions
- RewriteRule \.(?:jpe?g|gif|png)$ adaptive-images.php
-
- # END Adaptive-Images -------------------------------------------------------------------------------
-</IfModule>
-
- Anweisungen sind in der Datei als Kommentare enthalten (alle Zeilen die - mit # beginnen sind Kommentare und werden nicht ausgeführt)
-Folgen Sie den Anweisungen im Code um Verzeichnisse die nicht mit - Adaptive-Images benutzt werden sollen einzutragen.
- -Sie können die PHP-Datei öffnen und die Einstellungen im CONFIG Bereich ändern. - Die Standardwerte sehen so aus:
- -/* CONFIG ----------------------------------------------------------------------------------------------------------- */
-
-$resolutions = array(1382,992,768,480,320); // Die Auflösungsschritte für die Bilder erzeugt werden (Bildschirmbreite in Pixel)
-$cache_path = "ai-cache"; // Wo die verkleinerten Bilder gespeichert werden. Der Ordner muss beschreibbar sein.
-$jpg_quality = 80; // Die Qualität der erzeugten JPGs 0 bis 100
-$sharpen = TRUE; // Verkleinerte Bilder verlieren an Schärfe, bei TRUE werden die Bilder geschärft
-$watch_cache = TRUE; // stellt sicher das neu hochgeladene Bilder neu verkleinert werden
-$browser_cache = 60*60*24*7; // Die Zeit in Sekunden für den BROWSER cache (Standard 7 Tage)
-$mobile_first = TRUE; // Ist kein Cookie vorhanden wird zuerst die mobile Version gesendet (wenn FALSE, wird das grösste Bild gesendet)
-
-/* END CONFIG ----------------------------------------------------------------------------------------------------------
------------------------- Verändern Sie nichts nach dieser Zeile wenn Sie nicht wissen was Sie tun -------------------------
---------------------------------------------------------------------------------------------------------------------- */
- $resolutions
sind die Bildschirmauflösungen mit denen gearbeitet wird.
- Als Standard werden verkleinerte Bilder für grosse Bildschirme, normale Bildschirme,
- Tablets, Smartphones, und Handys gespeichert.
Im allgemeinen, wenn Sie die CSS Methode nutzen, werden diese Auflösungen - dieselben wie in den 'media queries' sein.
-$cache_path
Der Pfad in den die Bilder zwischengespeichert werden.
- Er kann beliebig geändert werden. Der Pfad wird hier eingetragen und es muss
- sichergestellt sein das er auf dem Server existiert.
$sharpen
Die bilder werden nach dem Verkleinern geschärft.
- Normal funktioniert das gut sollte ihr Server sehr sehr ausgelastet sein kann es hier abgeschaltet werdn. .
$watch_cache
Bei Performanceproblemen ihres Servers kann diese Option abgeschaltet werden.
- Sollten Sie allerdings ihre Quell-Bilder ersetzen müssen Sie den Cache Ordner manuell leeren.
$mobile_first
Wenn TRUE und kein cookie ist gesetzt, sendet Adaptive
- Images Bilder in der 'mobilen' Auflösung. Wenn FALSE gesetzt ist werden die am
- höchten aufgelössten Bilder gesendet.
Eine Schwäche von Adaptive Images ist das JavaScript zum Erkennen der -Bildschirmgrösse des Besuchers benötigt wird. -Im folgenden wird eine Methode ohne Javascript gezeigt. -Diese Methode funktioniert unter Vorbehalt wird allerdings vom Autor nicht empfohlen und nicht unterstützt. -
- -Benötigt kein JavaScript stattdessen aber, muss ÜBER ihrem normalen -CSS, folgende Zeilen eingefügt werden:
-<style>
- @media only screen and (max-device-width: 479px) {
- html { background-image:url(ai-cookie.php?maxwidth=479); } }
- @media only screen and (min-device-width: 480px) and (max-device-width: 767px) {
- html { background-image:url(ai-cookie.php?maxwidth=767); } }
- @media only screen and (min-device-width: 768px) and (max-device-width: 991px) {
- html { background-image:url(ai-cookie.php?maxwidth=991); } }
- @media only screen and (min-device-width: 992px) and (max-device-width: 1381px) {
- html { background-image:url(ai-cookie.php?maxwidth=1381); } }
- @media only screen and (min-device-width: 1382px) {
- html { background-image:url(ai-cookie.php?maxwidth=unknown); } }
-</style>
-Wenn Sie diese Mehode verwenden müssen Sie sicherstellen das die verwendeten
-Bildschirmauflösungen dennen in Ihrer adaptive-images.php Datei entsprechen,
-Sie benötigen zudem die ai-cookie.php
Datei im Hauptverzeichniss ihres Internetauftritts.
-(ansonsten wird diese Datei nicht benötigt).
Benutzen Sie diese Methode anstatt JS ist es möglich das besucher bei ihrem -ersten Besuch ihrer Seiten, die original hoch aufgelössten Bilder gesendet bekommen. -ALLE Seiten ihres Auftritts werden wie vorgesehen funktionieren. -Das bedeutet allerdings das Sie die Option $mobile_first auf FALSE setzen müssen. -Ansonsten werden die meisten ihrer Besucher feststellen das die angezeigten Bilder, - bei ihrem ersten Besuch zu klein dargestellt werden. -Otherwise, the majority of people who -
-Der Grund dafür ist die Reihenfolge wie Browser Internetseiten verarbeiten. -Als erstes wird das HTML geladen, und in der Reihenfolge wie es geschrieben wurde abgearbeitet. -Das eingebettete JavaScript wird sofort ausgeführt und erzeugt das Cookie. -Danach werden Bilder in der Reihenfolge ihres Auftrettens geladen. das heisst -werden die ersten Bilder vom Server angefordert ist das Cookie mit der Bildschirmgrösse -bereits geschrieben.
-Das ist bei der CSS Methode nicht unbedingt der Fall. Die CSS -Methode setzt eine externe Datei voraus - sie fordert vom Server -"background-image" an, welche von der PHP Datei nur benötigt wird um das Cookie zu setzen. -Das Problem ist das der Browser beim laden der externen Datein nicht anhält, -er arbeitet weiter während er auf die externe datei wartet. Das bedeutet das -schon Bilddateien angefordert werden können bevor die PHP Datei abgearbeitet wurde -und somit noch kein Cookie gesetzt wurde. Das wiederum heisst, daß wenn $mobile_first TRUE ist -die für mobile Geräte verkleinerten Bilder gesendet werden. Aber nur wenn die -allererste Seite geladen wird.
- - \ No newline at end of file diff --git a/readme.textile b/readme.textile index 14fb18e..b3a6678 100644 --- a/readme.textile +++ b/readme.textile @@ -1,21 +1,95 @@ -h1. Adaptive Images +h1. JavaScript Snippet for Detecting Screen Width (über-extended) -Is a solution to automatically create, cache, and deliver device-appropriate versions of your website's content images. It does not require you to change your mark-up. It is intended for use with "Responsive Designs":http://www.abookapart.com/products/responsive-web-design and to be combined with "Fluid Image":http://unstoppablerobotninja.com/entry/fluid-images/ techniques. +**Meant to be used with Adaptive Images and its forks, but can of course be altered to meet other needs as well.** -h2. Benefits +Since I "found out":http://www.quirksmode.org/mobile/tableViewport.html that the use of screen.width doesn’t always leave you with reliable results in conjunction with devicepixelratio, I looked for another solution to do it. And here is how. -* Ensures you and your visitors are not wasting bandwidth delivering images at a higher resolution than the vistor needs. -* Will work on your existing site, as it requires no changes to your mark-up. -* Is device agnostic (it works by detecting the size of the visitors screen) -* Is CMS agnostic (it manages its own image re-sizing, and will work on any CMS or even on flat HTML pages) -* Is entirely automatic. Once added to your site, you need do no further work. -* Highly configurable -** Set the resolutions you want to become adaptive (usually the same as the ones in your CSS @media queries) -** Choose where you want the cached files to be stored -** Configure directories to ignore (protect certain directories so AI is not applied to images within them) +**If you like serving for high-ppi ("retina") devices right: this is for you!** -Find out more, and view examples at "http://adaptive-images.com":http://adaptive-images.com -h2. Legal +h2. The Problem -Adaptive Images by Matt Wilcox is licensed under a "Creative Commons Attribution 3.0 Unported License":http://creativecommons.org/licenses/by/3.0/ \ No newline at end of file +When using AI, we rely on **screen.width** and **devicepixelratio** to detect the resolution (screen width and pixel ratio) to save it in the cookie. If we use the “long” version of the JS line to detect if a high-ppi (“retina”) device is present, we afterwards multiply the found screen width with the pixel ratio – doubling the image size to be served. This will work fine in browsers which actually return “wrong” values for screen.width: they report the theoretical screen resolution = CSS pixels = device independent pixels = dips. So what we’re basically doing is: relying on “bad behavior”; relying on a buggy and wrong implementation. + +Why? Because "according to quirksmode":http://www.quirksmode.org/mobile/tableViewport.html, screen.width is actually meant to return the **real physical size** of the screen – _not the dips!_ + +So: if you “accidentially” serve to a browser that does it _right_, you end up doubling the already doubled screen size – ergo image size. +And if you’re like me, taking into account even device pixel ratios >2 (possible with "the fork I’m using":https://github.com/Darkwing371/Adaptive-Images-Uber-Extended), it could happen that you serve a 5760px image to a screen that has only 640px of theoretical width (worst case). + + +h2. The Reality Check + +So is this a real world problem? Decide for yourself. + +"Quirksmode":http://www.quirksmode.org/mobile/tableViewport.html reports, that on new Android phones, Blackberries, newer Nokias and on mobile Firefoxes, the screen size which screen.width would report, is based on the actual device pixels. Thus being right, it would actually cause us problems. + +So with ppks compatiblity table in mind, I went downtown to do a real life countercheck. Here are my findings: + +Device | screen.width | mediaMatch |
---|---|---|
iPad | 1024,2 | 1024,2 |
iPhone 4 | 480,2 | 480,2 |
iPhone 5 | 568,2 | 568,2 |
MacBook Pro 13" | 1280,2 | 1280,2 |
MackBook Pro 15" | 1440,1 | 1440,1 |
MackBook Air 11" | *1366,1* | *1368,1* |
MacBook Air 13" | 1440,1 | 1440,1 |
Sony Xperia (Chrome) | *1794,3* | *600,3* |
HTC One (Chrome) | *1920,3* | *640,3* |
HTC One X (Chrome) | 1280,2 | 1280,2 |
Samsung Galaxa S III | 1280,2 | 1280,2 |
Samsung Galaxy Note II | 1280,2 | 1280,2 |
Samsung Galaxy Tab 2 | 1280,1 | 1280,1 |
Huawei Ascend | 800,1.5 | 800,1.5 |
Nokia Lumia | 800,1 | 800,1 |