-
Notifications
You must be signed in to change notification settings - Fork 4
Add support for DDS decoding #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Tests currently don't pass, because the testing infrastructure doesn't support |
Yes, that's precisely the use-case for which the override was designed. Good to see it working correctly in action. |
|
The |
|
Good to know. I might make a PR for that later, since it's really unexpected that In any case, I'm not sure if the TIFF color issue should block this PR. I mean, if different decoders cannot agree on how to interpret a reference file, is it a good reference? Also, are there any plans to extend |
|
There's no immediate plans to add hooks for image encoding, though you can already use And yeah, the TIFF issue shouldn't be blocking. I'm pretty sure that whatever color differences are happening with the viewers you're using, they're being applied after reading the raw pixel data. And since the reference tests don't attempt to apply tone mapping those difference shouldn't matter |
That's unfortunate.
Then it's ready to review. I have the DDS encoder ready as well, but I'll make that a separate PR to not hold off this one or release (in case you're waiting on DDS support). |
|
Question: What's the policy for trait bounds in structs? All encoders and decoders are generic over the writer/reader. Should the struct contain that trait bound? So E.g. |
|
The struct itself probably should not contain trait bounds. There's a bunch of structs that have been declared a long time ago, and not touched up since. |
|
@fintelia: In my opinion, the constructor should have a bound even if it does not read itself. But we never made an explicit decision on that policy iirc. |
|
I agree with that. On a similar note: what should the trait bound on the reader for decoders be? When implementing |
|
Whether to have a What sources/licensing status for the test images? |
The cubemap is Pretoria Gardens, which is CC0. The other images I created myself. If you need a license for those too, then they are hereby CC0. |


This PR takes the decoder part (and ONLY the decoder part) of image-rs/image#2461 and adds it to
image-extras. As such, the implementation is relatively simple, since theddscrate does the actual decoding work.Q: Should I also include the encoder part of image-rs/image#2461? If so, the testing infra should probably be extended to test encoders.
The only thing which confused me is that this works at all. The
imagecrate currently still supports DDS images, so I don't really understand why it lets me add support for DDS as a plugin. With both theimage/ddsandimage-extras/ddsfeatures enable,imagewill use the plugin instead of its own DDS implementation. I'm not sure if this behavior is intentional, but it is useful in this case, becauseimage's DDS implementation can't decode any of my test images.