Summary: | EXIF orientation is ignored for some CSS images | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Simon Fraser (smfr) <simon.fraser> | ||||||||||||||
Component: | CSS | Assignee: | Said Abou-Hallawa <sabouhallawa> | ||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||
Severity: | Normal | CC: | commit-queue, esprehn+autocc, ews-watchlist, glenn, jbedard, kondapallykalyan, pdr, sabouhallawa, simon.fraser, webkit-bug-importer | ||||||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||||||
Version: | WebKit Nightly Build | ||||||||||||||||
Hardware: | Unspecified | ||||||||||||||||
OS: | Unspecified | ||||||||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=201123 | ||||||||||||||||
Bug Depends on: | |||||||||||||||||
Bug Blocks: | 89052 | ||||||||||||||||
Attachments: |
|
Created attachment 387973 [details]
Patch
Created attachment 388093 [details]
Patch
(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. Created attachment 388097 [details]
Patch
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? 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; Created attachment 388116 [details]
Patch
Created attachment 388248 [details]
Patch
Comment on attachment 388248 [details] Patch Clearing flags on attachment: 388248 Committed r254841: <https://trac.webkit.org/changeset/254841> All reviewed patches have been landed. Closing bug. Test was landed broken: https://results.webkit.org/?suite=layout-tests&test=scrollingcoordinator%2Fmac%2Ffixed-scrolled-body.html (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. |
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.