OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script> | 3 <script> |
4 if (window.testRunner) { | 4 if (window.testRunner) { |
5 testRunner.overridePreference('WebKitShouldRespectImageOrientation', 1); | 5 testRunner.overridePreference('WebKitShouldRespectImageOrientation', 1); |
6 testRunner.dumpAsTextWithPixelResults(); | 6 testRunner.dumpAsTextWithPixelResults(); |
7 } | 7 } |
8 | 8 |
9 function log(str) { | 9 function log(str) { |
10 var li = document.createElement("li"); | 10 var li = document.createElement("li"); |
11 li.appendChild(document.createTextNode(str)); | 11 li.appendChild(document.createTextNode(str)); |
12 var console = document.getElementById("console"); | 12 var console = document.getElementById("console"); |
13 console.appendChild(li); | 13 console.appendChild(li); |
14 } | 14 } |
15 | 15 |
16 function imageSize(el) { | 16 function imageSize(el) { |
17 var computedStyle = window.getComputedStyle(el); | 17 var computedStyle = window.getComputedStyle(el); |
18 return computedStyle.width + " by " + computedStyle.height; | 18 return computedStyle.width + " by " + computedStyle.height; |
19 } | 19 } |
20 | 20 |
21 | 21 |
22 function load() { | 22 function load() { |
23 for(var i = 1; i <= 9; i++) | 23 for(var i = 1; i <= 9; i++) |
24 log("img" + i + " size = " + imageSize(document.getElementById("img" + i
))) | 24 log("img" + i + " size = " + imageSize(document.getElementById("img" + i
))) |
25 } | 25 } |
26 | 26 |
27 </script> | 27 </script> |
28 <style> | 28 <style> |
| 29 body { overflow: hidden; } |
29 img { border: 1px solid black; } | 30 img { border: 1px solid black; } |
30 div { display: inline-block; margin-right: 20px; margin-bottom: 10px; width: 100
px; vertical-align: top; } | 31 div { display: inline-block; margin-right: 20px; margin-bottom: 10px; width: 100
px; vertical-align: top; } |
31 </style> | 32 </style> |
32 </head> | 33 </head> |
33 <body onload="load()"> | 34 <body onload="load()"> |
34 <b>The images should be rotated respecting their EXIF orientation. This test can
only be run with testRunner (or by manually setting WebKitShouldRespectImageOri
entation to true).</b><br><br> | 35 <b>The images should be rotated respecting their EXIF orientation. This test can
only be run with testRunner (or by manually setting WebKitShouldRespectImageOri
entation to true).</b><br><br> |
35 <div><img id="img1" src="resources/exif-orientation-1-ul.jpg"><br>Normal</div> | 36 <div><img id="img1" src="resources/exif-orientation-1-ul.jpg"><br>Normal</div> |
36 <div><img id="img2" src="resources/exif-orientation-2-ur.jpg"><br>Flipped horizo
ntally</div> | 37 <div><img id="img2" src="resources/exif-orientation-2-ur.jpg"><br>Flipped horizo
ntally</div> |
37 <div><img id="img3" src="resources/exif-orientation-3-lr.jpg"><br>Rotated 180&de
g;</div> | 38 <div><img id="img3" src="resources/exif-orientation-3-lr.jpg"><br>Rotated 180&de
g;</div> |
38 <div><img id="img4" src="resources/exif-orientation-4-lol.jpg"><br>Flipped verti
cally</div> | 39 <div><img id="img4" src="resources/exif-orientation-4-lol.jpg"><br>Flipped verti
cally</div> |
39 <br> | 40 <br> |
40 <div><img id="img5" src="resources/exif-orientation-5-lu.jpg"><br>Rotated 90°
; CCW and flipped vertically</div> | 41 <div><img id="img5" src="resources/exif-orientation-5-lu.jpg"><br>Rotated 90°
; CCW and flipped vertically</div> |
41 <div><img id="img6" src="resources/exif-orientation-6-ru.jpg"><br>Rotated 90°
; CCW</div> | 42 <div><img id="img6" src="resources/exif-orientation-6-ru.jpg"><br>Rotated 90°
; CCW</div> |
42 <div><img id="img7" src="resources/exif-orientation-7-rl.jpg"><br>Rotated 90°
; CW and flipped vertically </div> | 43 <div><img id="img7" src="resources/exif-orientation-7-rl.jpg"><br>Rotated 90°
; CW and flipped vertically </div> |
43 <div><img id="img8" src="resources/exif-orientation-8-llo.jpg"><br>Rotated 90&de
g; CW</div> | 44 <div><img id="img8" src="resources/exif-orientation-8-llo.jpg"><br>Rotated 90&de
g; CW</div> |
44 <br> | 45 <br> |
45 <div><img id="img9" src="resources/exif-orientation-9-u.jpg"><br>Undefined (inva
lid value)</div> | 46 <div><img id="img9" src="resources/exif-orientation-9-u.jpg"><br>Undefined (inva
lid value)</div> |
46 <br> | 47 <br> |
47 <ul id="console"></ul> | 48 <ul id="console"></ul> |
48 </body> | 49 </body> |
49 </html> | 50 </html> |
OLD | NEW |