[09:25:52] <wiredfool> yeah. and I probably have the most experience with plugins, and I've really only hacked on the libtiff one.
[09:26:23] <jleclanche> so what im trying to do is in load(), decode the s3tc-compressed data into rgba
[09:26:39] <wiredfool> the two newest, _webp and Jpeg2k were contributed, and Jpeg2k is broken in threading, adn someone has sent a pr to replace the webp one.
[09:27:59] <jleclanche> i take it you saw my reply on gh?
[09:36:35] <jleclanche> wiredfool: here's a test dds file: http://code.qt.io/cgit/qt/qtimageformats.git/tree/tests/shared/images/dds/DXT1.dds?id=a4670f609c48fed61cbacf1a0a780ea27483ce18
[09:39:35] <wiredfool> First thing, Image.frombytes returns an Image object, not a core image object. self.im is a core image object
[09:41:10] <wiredfool> Then when you overload ImageFile.load, you're clearing self.tile, and then calling super().load(), which relies on the tile for the decoding
[09:41:41] <wiredfool> the most minimal plugin that I've seen is the WebpImagePlugin
[09:42:06] <wiredfool> which decodes everything on _open, then passes a BytesIO and a raw tile to the load method
[09:42:52] <wiredfool> On the downside, that decodes everything in one shot, not doing lazy loading like the rest of Pillow. OTOH, it's dead simple and works well
[09:46:07] <jleclanche> wiredfool: perf wise im not too concerned since ideally this *would* be rewritten in c
[09:46:28] <jleclanche> wiredfool: i mean i guess the ideal method would be dxt5 / dxt1 pixel format in decode.c
[09:46:57] <jleclanche> it's just really annoying when writing a custom plugin
[09:47:14] <jleclanche> to be honest, you should be able to pass a callable instead of a decoder string
[09:47:16] <wiredfool> It's really annoying trying to understand it, even through I've done it before
[09:47:56] <wiredfool> It's way too many layers of abstraction and delegation to the c layer
[09:49:34] <jleclanche> wiredfool: how likely is a new plugin api to happen?
[09:49:41] <wiredfool> I basically have to trace things to figure it out anew each time. But to be fair, the Tiff one is as complicated as it gets. But figuring out where it converts mode to rawmode, or when it's passing anything back.
[10:45:30] <jleclanche> the biggest ones would be 2048x2048 probably but they'd be rare
[10:45:36] <jleclanche> it's used for game textures
[10:51:02] <wiredfool> so probably not too bad to just open, especially since there's no metadata in them that people are likely to want without decoding