summaryrefslogtreecommitdiff
path: root/source/bower_components/modernizr/feature-detects/exif-orientation.js
diff options
context:
space:
mode:
Diffstat (limited to 'source/bower_components/modernizr/feature-detects/exif-orientation.js')
-rw-r--r--source/bower_components/modernizr/feature-detects/exif-orientation.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/source/bower_components/modernizr/feature-detects/exif-orientation.js b/source/bower_components/modernizr/feature-detects/exif-orientation.js
new file mode 100644
index 0000000..994c13d
--- /dev/null
+++ b/source/bower_components/modernizr/feature-detects/exif-orientation.js
@@ -0,0 +1,32 @@
+// EXIF Orientation test
+
+// iOS looks at the EXIF Orientation flag in jpgs and rotates the image
+// accordingly. Looks like most desktop browsers just ignore this data.
+
+// description: www.impulseadventure.com/photo/exif-orientation.html
+
+// Bug trackers:
+// bugzil.la/298619 (unimplemented)
+// crbug.com/56845 (looks incomplete)
+// webk.it/19688 (available upstream but its up all ports to turn on individually)
+//
+
+// detect by Paul Sayre
+
+
+(function(){
+
+ var img = new Image();
+
+ img.onerror = function() {
+ Modernizr.addTest('exif-orientation', function () { return false; });
+ };
+
+ img.onload = function() {
+ Modernizr.addTest('exif-orientation', function () { return img.width !== 2; });
+ };
+
+ // There may be a way to shrink this more, it's a 1x2 white jpg with the orientation flag set to 6
+ img.src = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QAiRXhpZgAASUkqAAgAAAABABIBAwABAAAABgASAAAAAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAABAAIDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/iiiigD/2Q==";
+
+})();