Open haraldk opened 5 days ago
I'm not going to give you a programming lesson on how to debug your own code
You can save the programming lessons for someone who needs that... 😉
But some friendly advice on how to implement reading the header only in your code would be appreciated.
As mentioned in #20, I'm working on an ImageIO plugin for JPEG XL using your decoder. For this to work reasonably, I need a way to read the header (
ImageHeader
) without also decoding the entire image.I've added a method to
JXLCodestreamDecoder
, like this:(I also made some minor tweaks to initialize
canvas
in thedecode
method to avoid NPE). This kind of works, but in some cases it seems to create what I believe is alignment issues in the codestream when I later invokedecode()
. Causing exceptions like:For
samples/ants.jxl
as an example:I can work around this, by repositioning the stream and creating a new decoder for reading the image after reading the header. But it would be nice to have a method that could read the header without other side effects. My plan was to create a PR with the above code, but it's no good until we can fix the alignment issues.