Bug 231934
Summary: | Image::orientation() shouldn't return ImageOrientation::FromImage | ||
---|---|---|---|
Product: | WebKit | Reporter: | Cameron McCormack (:heycam) <heycam> |
Component: | Images | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | sabouhallawa, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Local Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Cameron McCormack (:heycam)
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/84643755>