Bug 48138 - texImage2D does not respect orientation of underlying image
Summary: texImage2D does not respect orientation of underlying image
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: All OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-22 10:35 PDT by Dean Jackson
Modified: 2024-01-17 01:04 PST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Jackson 2010-10-22 10:35:39 PDT
The image object passed to texImage2D might come from a source that has set a non-zero orientation. At the moment, the texImage2D implementation ignores this and calls the native method with the CGImage that the image object holds. This means if you load an image format that supports orientation, and the orientation is non-zero, then the texture will be using the wrong width and height.

CGImage doesn't know about orientation either, so the native call to texImage2D is doing the right thing. It's just that the higher level API of WebGL doesn't allow us to rotate the image - <img> elements have no concept of orientation.
Comment 1 Kenneth Russell 2010-10-22 10:37:30 PDT
What image formats support orientation?
Comment 2 Dean Jackson 2010-10-22 10:39:33 PDT
PNG and TIFF for example.
Comment 3 Dean Jackson 2010-10-22 10:39:53 PDT
I will make a test case soon. Just not today.
Comment 4 Zhenyao Mo 2010-10-22 10:44:39 PDT
We might want to revisit the image format issue in WebGL.  Possibly posing some limitation for what image formats WebGL will support.

I've uploaded at least 5 patches for that function in GraphicsContext3DCG.coo already, and there are still so several cases not covered.
Comment 5 Zhenyao Mo 2010-10-22 10:46:34 PDT
I am also curious if Skia is honoring the orientations.  Once Dean uploads a test case, I will verify that.
Comment 6 Dean Jackson 2010-10-22 11:08:20 PDT
Yeah, maybe Skia rearranges the data as it loads - that would be nice. 

This same problem can hit native code using CGImage. The difference here is that we don't have any way to know the source orientation.
Comment 7 Kimmo Kinnunen 2024-01-17 01:04:58 PST
Should work now, WebGL CTS has tests