Conversation
|
This looks good from a functional standpoint, but it's not something I'd accept for inclusion in the main library in its current state. The implementation is not really in keeping with the design philosophy of this project (for example, it should be resilient to truncated streams, and even though ICO images are tiny, using a reference-type enumerable to iterate over pixel and transparency data is silly wasteful). It also doesn't conform to the code style of the rest of the project (this is largely my fault for not providing a more complete That said, I'm very pleased you were able to put this together, and it looks at first glance like you were able to do so without using any internal APIs. It would be worth looking at opportunities to improve the main library's surface to make it easier to build plugins like this, as I can see a couple of places internal functionality would have been useful. e.g. instead of creating an entire new pipeline for embedded PNG frames, it would be nice to be able to use How about making this a separate plugin library, in the Longer term, I'd think an ICO codec could delegate to either BMP or PNG for the individual frame decoding so that it acts only as a container demuxer, or it could be integrated with the BMP codec directly. As for when BMP will be supported xplat, I've started on a managed codec (decode is always harder than encode), but I need to make some changes to the way format conversion is currently implemented. I've got some of that work done already as well, but it's been difficult to dedicate time to this project with most of my funding drying up in the last couple of years. |
|
Yeah, I didn't expected it to be accepted as-is and submited it to collect feedback on what should be fixed.
|
It's not shipped as a package today, but there's no reason it couldn't be. I'm planning to get some work done on the managed BMP codec in the new year, and I think this will fit in better once that's done. Will check back with you at that time. |
For review.
ICO decoder with access to all images in container as frames. Windows built-in decoder expose single image and not available on other platforms.
Implementation is tested on ~4K ICO files from different sources.
Notes on implementation:
General notes on found issues:
ImageFileInfo.FrameInfowith additional information like source BPP. Consider following scenario for ICO:User need to extract image version with best quality. For that currently we can only inspect frame dimensions to pick biggest one. This doesn't work if container provides several image versions with different color depth.
Side question: could we expect TIFF and BMP support for Linux platform soon? Personally we need only decoder, so if this part is ready - it would be nice to release it sooner.