AcademySoftwareFoundation / AcademySoftwareFoundation/OpenImageIO
[FEATURE REQUEST]Make image format autodetection work with IOProxy/IOMemBuffer
- Dominant language
- C++
- Stars
- 2.4k
- Forks
- 698
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 48
Description
**Is your feature request related to a problem? Please describe.**
When reading a texture file with OIIO, it is able to find the correct image reader if the extension is missing (I believe by testing all plugins, but this could be detected with magic numbers). When reading an image from an IOMemBuffer or a custom IOProxy, this doesn't work, the ImageCache file name must contain the proper extension or it won't load the file, with error messages:
> Shader error [colorshader_texture]: Invalid image file "A6283DE8-F912-B0C8-04AC-D34B8265F2A9": Image "A6283DE8-F912-B0C8-04AC-D34B8265F2A9" does not exist. Also, it is not the name of an image format that OpenImageIO recognizes.
**Describe the solution you'd like**
It would be useful if format detection could work also in this case.
**Describe alternatives you've considered**
Currently I have find the format from first bytes (magic numbers) and add the extension to texture names (which are GUIDs in my case)
Contributor guide
Research direction
Start by tracing image loading through IOProxy and IOMemBuffer, then compare it with the existing extensionless texture autodetection path. Reproduce the case using image data whose texture name has no extension, and verify that format detection succeeds without adding an extension to the name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100