Closed zhou13 closed 1 year ago
Looks like a bug/limitation in libjxl. Try other encoding parameters (e.g. lossy mode with level=99
) or use your workaround until the issue is fixed in a future version of libjxl.
It would be helpful to print the error from JxlEncoderGetError so we can know what the error is.
That's on the TODO list but would not help in this case as JxlEncoderGetError
just returns JXL_ENC_ERR_GENERIC
.
To reproduce the error, use:
Here is the example buffer: 1.npy.zip
I got error
The error seems to be size related rather than content-related: If I slice the buffer to be smaller, or if I do
imwrite("1.jxl", np.float32(buffer.astype(np.float16)))
, the error will go away. The region I slice does not matter too much.It would be helpful to print the error from
JxlEncoderGetError
so we can know what the error is.