RESOLVED FIXED 100698
Add a test for reading exif orientation off image documents
https://bugs.webkit.org/show_bug.cgi?id=100698
Summary Add a test for reading exif orientation off image documents
Nico Weber
Reported 2012-10-29 14:22:59 PDT
Add a test for reading exif orientation off image documents
Attachments
Patch (4.89 KB, patch)
2012-10-29 14:23 PDT, Nico Weber
no flags
Patch (4.98 KB, patch)
2012-10-29 16:34 PDT, Nico Weber
no flags
Patch (5.11 KB, patch)
2012-10-29 16:36 PDT, Nico Weber
no flags
Patch for landing (6.03 KB, patch)
2012-10-29 20:03 PDT, Nico Weber
no flags
Patch for landing (6.07 KB, patch)
2012-10-29 21:13 PDT, Nico Weber
no flags
Nico Weber
Comment 1 2012-10-29 14:23:43 PDT
Eric Seidel (no email)
Comment 2 2012-10-29 16:17:02 PDT
Comment on attachment 171313 [details] Patch Could we make this say PASS/FAIL instead? You, the test writer, have that information better than someone bringing up a new port and staring at this for the first time. :)
Nico Weber
Comment 3 2012-10-29 16:34:48 PDT
Nico Weber
Comment 4 2012-10-29 16:35:25 PDT
(In reply to comment #2) > (From update of attachment 171313 [details]) > Could we make this say PASS/FAIL instead? You, the test writer, have that information better than someone bringing up a new port and staring at this for the first time. :) Sure thing, done. (I copied the behavior of exif-orientation.html, but I agree that it's better now.)
Nico Weber
Comment 5 2012-10-29 16:36:56 PDT
Eric Seidel (no email)
Comment 6 2012-10-29 16:37:16 PDT
Comment on attachment 171334 [details] Patch I would have done something like expectHorizontal(1); expectVertical(2); for each of the cases. But this is fine too.
WebKit Review Bot
Comment 7 2012-10-29 17:59:06 PDT
Comment on attachment 171335 [details] Patch Rejecting attachment 171335 [details] from commit-queue. New failing tests: platform/chromium/virtual/deferred/fast/images/exif-orientation-image-document.html Full output: http://queues.webkit.org/results/14631303
WebKit Review Bot
Comment 8 2012-10-29 18:57:49 PDT
Comment on attachment 171334 [details] Patch Attachment 171334 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/14623550 New failing tests: platform/chromium/virtual/deferred/fast/images/exif-orientation-image-document.html
Nico Weber
Comment 9 2012-10-29 20:03:11 PDT
Created attachment 171364 [details] Patch for landing
Nico Weber
Comment 10 2012-10-29 20:04:50 PDT
hclam: The test I'm adding in this CL fails with in the deferred image decoding suite. I'm adding it to TestExpectations to the block of other failing tests. It'll need to be fixed before deferred decoding can become turned on by default.
Hin-Chung Lam
Comment 11 2012-10-29 20:06:03 PDT
(In reply to comment #10) > hclam: The test I'm adding in this CL fails with in the deferred image decoding suite. I'm adding it to TestExpectations to the block of other failing tests. It'll need to be fixed before deferred decoding can become turned on by default. okay sounds good to me.
WebKit Review Bot
Comment 12 2012-10-29 20:53:04 PDT
Comment on attachment 171364 [details] Patch for landing Rejecting attachment 171364 [details] from commit-queue. New failing tests: platform/chromium/virtual/deferred/fast/images/exif-orientation-image-document.html Full output: http://queues.webkit.org/results/14642307
Nico Weber
Comment 13 2012-10-29 21:13:12 PDT
Created attachment 171368 [details] Patch for landing
WebKit Review Bot
Comment 14 2012-10-30 01:02:53 PDT
Comment on attachment 171368 [details] Patch for landing Clearing flags on attachment: 171368 Committed r132877: <http://trac.webkit.org/changeset/132877>
WebKit Review Bot
Comment 15 2012-10-30 01:03:01 PDT
All reviewed patches have been landed. Closing bug.
noel gordon
Comment 16 2012-10-31 03:22:44 PDT
Chromium Expectations added in r132989 <http://trac.webkit.org/changeset/132989>
Dominik Röttsches (drott)
Comment 17 2012-11-06 06:38:35 PST
Nico, are you sure this should work without overriding the preference? My suspicion is, it passes on Chromium since the preference is default on, isn't it? I would suggest to add testRunner.overridePreference('WebKitShouldRespectImageOrientation', 1);
Nico Weber
Comment 18 2012-11-06 07:52:49 PST
Hi Dominik, (In reply to comment #17) > Nico, are you sure this should work without overriding the preference? Yes, that's correct: The preference controls if exif information is used for <img> elements in html documents. For image documents, exif information is always used on ports that support it. > My suspicion is, it passes on Chromium since the preference is default on, isn't it? No, the pref is off by default in chromium, and we don't plan to turn it on in the close future. > I would suggest to add > testRunner.overridePreference('WebKitShouldRespectImageOrientation', 1); That won't have an effect on the test. For the exif stuff to work, your port needs to have explicit code to support drawing of rotated images. For that reason, RenderObject::shouldRespectImageOrientation() has an #ifdef for the imagedocument code that's currently only on for mac and chromium. If your port's drawing code doesn't support honoring image orientation, then without that ifdef images would be laid out according to their exif information, but then only stretched (instead of rotated) at paint time – which is worse than them being 90 degree rotated. (To see what I mean, remove the ifdef in RenderObject::shouldRespectImageOrientation() and look at the test this bug added in your port). If you want to get this test passing on your port, you need to implement drawing support first and then enable the ifdef for your port.
Eric Seidel (no email)
Comment 19 2012-11-06 11:45:15 PST
Comment on attachment 171368 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=171368&action=review Isn't this a text test? > LayoutTests/platform/chromium/TestExpectations:3829 > +Bug(thakis) fast/images/exif-orientation-image-document.html [ ImageOnlyFailure ] image?
Nico Weber
Comment 20 2012-11-06 12:48:04 PST
(In reply to comment #19) > (From update of attachment 171368 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=171368&action=review > > Isn't this a text test? No. The test says `testRunner.dumpAsText(true);`, and the `true` means "generate pixel dumps" as far as I know. If your question is "shouldn't it be sufficient to make this a text-only test?": No, because the image bounds alone don't tell you if an image is upside down. > > > LayoutTests/platform/chromium/TestExpectations:3829 > > +Bug(thakis) fast/images/exif-orientation-image-document.html [ ImageOnlyFailure ] > > image?
Dominik Röttsches (drott)
Comment 21 2012-11-06 23:49:51 PST
(In reply to comment #18) Thanks Nico for the detailed explanations. I did implement the rotation/flipping code in bug 101207 for Cairo, however, i didn't find that RenderObject #ifdef earlier. > > I would suggest to add > > testRunner.overridePreference('WebKitShouldRespectImageOrientation', 1); > > That won't have an effect on the test. Actually, it does. If I enable the setting inside the test, it passes on Cairo/EFL since the second line of the if-condition in RenderObject::shouldRespectImageOrientation checks for the setting. > For the exif stuff to work, your port needs to have explicit code to support drawing of rotated images. For that reason, RenderObject::shouldRespectImageOrientation() has an #ifdef for the imagedocument code that's currently only on for mac and chromium. [...] If you want to get this test passing on your port, you need to implement drawing support first and then enable the ifdef for your port. Yep, I'll add USE(CAIRO) to the ifdef in RenderObject that you mentioned. Thanks again.
Note You need to log in before you can comment on or make changes to this bug.