WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
231934
Image::orientation() shouldn't return ImageOrientation::FromImage
https://bugs.webkit.org/show_bug.cgi?id=231934
Summary
Image::orientation() shouldn't return ImageOrientation::FromImage
Cameron McCormack (:heycam)
Reported
2021-10-18 19:56:37 PDT
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
Comment 1
2021-10-25 19:57:18 PDT
<
rdar://problem/84643755
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug