RESOLVED FIXED 203355
EXIF orientation is ignored for some CSS images
https://bugs.webkit.org/show_bug.cgi?id=203355
Summary EXIF orientation is ignored for some CSS images
Simon Fraser (smfr)
Reported 2019-10-23 22:31:57 PDT
Created attachment 381775 [details] Testcase We ignore EXIF orientation when hitting the rendering codepaths that go through GraphicsContext::drawTiledImage(), so fail to respect EXIF orientation for CSS images in tiled background-image, border-image etc.
Attachments
Testcase (8.82 KB, application/zip)
2019-10-23 22:31 PDT, Simon Fraser (smfr)
no flags
Patch (19.96 KB, patch)
2020-01-16 15:47 PST, Said Abou-Hallawa
no flags
Patch (28.22 KB, patch)
2020-01-17 15:07 PST, Said Abou-Hallawa
no flags
Patch (28.31 KB, patch)
2020-01-17 15:34 PST, Said Abou-Hallawa
no flags
Patch (28.30 KB, patch)
2020-01-17 16:49 PST, Said Abou-Hallawa
no flags
Patch (30.23 KB, patch)
2020-01-20 11:14 PST, Said Abou-Hallawa
no flags
Radar WebKit Bug Importer
Comment 1 2019-10-23 22:33:57 PDT
Said Abou-Hallawa
Comment 2 2020-01-16 15:47:55 PST
Said Abou-Hallawa
Comment 3 2020-01-17 15:07:36 PST
Said Abou-Hallawa
Comment 4 2020-01-17 15:08:49 PST
(In reply to Said Abou-Hallawa from comment #3) > Created attachment 388093 [details] > Patch In this patch the EXIF orientation is respected with css background images and css border images.
Said Abou-Hallawa
Comment 5 2020-01-17 15:34:24 PST
Simon Fraser (smfr)
Comment 6 2020-01-17 16:31:01 PST
Comment on attachment 388097 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=388097&action=review > Source/WebCore/platform/graphics/BitmapImage.cpp:162 > + FloatRect rect = { IntPoint::zero(), size() }; It's a bit weird to initialize the location of a FloatRect with IntPoint::zero Is size() computed respecting orientation? I.e. do we know this code won't distort the image?
Said Abou-Hallawa
Comment 7 2020-01-17 16:38:23 PST
Comment on attachment 388097 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=388097&action=review >> Source/WebCore/platform/graphics/BitmapImage.cpp:162 >> + FloatRect rect = { IntPoint::zero(), size() }; > > It's a bit weird to initialize the location of a FloatRect with IntPoint::zero > > Is size() computed respecting orientation? I.e. do we know this code won't distort the image? I will replace the IntPoint::zero() by FloatPoint(). Yes size() is computed respecting orientation since it takes an ImageOrientation argument which has a default value 'FromImage'. The definition of it in Image.h is virtual FloatSize size(ImageOrientation = ImageOrientation::FromImage) const = 0;
Said Abou-Hallawa
Comment 8 2020-01-17 16:49:26 PST
Said Abou-Hallawa
Comment 9 2020-01-20 11:14:35 PST
WebKit Commit Bot
Comment 10 2020-01-20 18:54:27 PST
Comment on attachment 388248 [details] Patch Clearing flags on attachment: 388248 Committed r254841: <https://trac.webkit.org/changeset/254841>
WebKit Commit Bot
Comment 11 2020-01-20 18:54:28 PST
All reviewed patches have been landed. Closing bug.
Said Abou-Hallawa
Comment 14 2020-01-21 15:53:51 PST
(In reply to Jonathan Bedard from comment #13) > Oops, wrong tests: > https://results.webkit.org/?suite=layout-tests&suite=layout- > tests&test=fast%2Fimages%2Fexif-orientation-border-image. > html&test=fast%2Fimages%2Fexif-orientation-background-image-no-repeat.html Yes. The non CG ports have to skip these tests or to respect the EXIF image orientation when drawing the native image for CSS background and border.
Note You need to log in before you can comment on or make changes to this bug.