4 if (window.layoutTestController) {
5 layoutTestController.overridePreference('WebKitShouldRespectImageOrientation', 1);
6 layoutTestController.dumpAsText(1);
10 var li = document.createElement("li");
11 li.appendChild(document.createTextNode(str));
12 var console = document.getElementById("console");
13 console.appendChild(li);
16 function imageSize(el) {
17 var computedStyle = window.getComputedStyle(el);
18 return computedStyle.width + " by " + computedStyle.height;
23 for(var i = 1; i <= 9; i++)
24 log("img" + i + " size = " + imageSize(document.getElementById("img" + i)))
29 img { border: 1px solid black; }
30 div { display: inline-block; margin-right: 20px; margin-bottom: 10px; width: 100px; vertical-align: top; }
33 <body onload="load()">
34 <b>The images should be rotated respecting their EXIF orientation. This test can only be run with layoutTestController (or by manually setting WebKitShouldRespectImageOrientation to true).</b><br><br>
35 <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 horizontally</div>
37 <div><img id="img3" src="resources/exif-orientation-3-lr.jpg"><br>Rotated 180°</div>
38 <div><img id="img4" src="resources/exif-orientation-4-lol.jpg"><br>Flipped vertically</div>
40 <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="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° CW</div>
45 <div><img id="img9" src="resources/exif-orientation-9-u.jpg"><br>Undefined (invalid value)</div>
47 <ul id="console"></ul>