[Webkit-unassigned] [Bug 231934] New: Image::orientation() shouldn't return ImageOrientation::FromImage
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Oct 18 19:56:37 PDT 2021
https://bugs.webkit.org/show_bug.cgi?id=231934
Bug ID: 231934
Summary: Image::orientation() shouldn't return
ImageOrientation::FromImage
Product: WebKit
Version: WebKit Local Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: Images
Assignee: webkit-unassigned at lists.webkit.org
Reporter: heycam at apple.com
CC: sabouhallawa at apple.com
It's a bit weird that Image::orientation() has a default implementation that returns ImageOrientation::FromImage. I think Image::orientation() should return the image's native orientation metadata, and so for image types that don't have any orientation metadata, a better default would be ImageOrientation::None. There are places in the code where we check for FromImage and turn it into None, because we need a concrete orientation value to call e.g. swapsWidthAndHeight() on.
We could:
1. Rename Image::orientation() to say nativeOrientation(), make it protected, and add a new public Image::orientation() accessor that calls nativeOrientation() and asserts that its return value is not FromImage.
2. Have two types -- ImageOrientation, as it is now, and a new type (NativeImageOrientation? ResolvedImageOrientation? Orientation?) that doesn't have a FromImage value. Then update functions to take the appropriate type.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211019/9e2a428a/attachment-0001.htm>
More information about the webkit-unassigned
mailing list