emscripten-core / emscripten-core/emscripten
preloaded image data is underspecified and unusable
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
The current helper functions
* `emscripten_get_preloaded_image_data`
* `emscripten_get_preloaded_image_data_from_FILE`
Do not appear to give any information about the image other than the dimensions. There's no output parameters for the number of components, the pixel format, or the bits per pixel. I'm not sure how to use these functions since I need that information.
Is the assumption that the data from preloading an image that it'll always be RGBA8? What about for PNGs that are 16-bit or 32-bit component formats? Something like a JPG doesn't have an alpha so would the content from this function be RGB8 in that case? Is the content even interleaved or planar? Some documentation about the expected pixel format and layout would be appreciated or just some new functions that fill out this information.
Contributor guide
Assessment
This issue has not been assessed yet.