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.
<rdar://problem/84643755>