-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Rewrite of Jpeg2k data handling #1934
Rewrite of Jpeg2k data handling #1934
Conversation
2a2927c
to
ee28776
Compare
ee28776
to
130a12c
Compare
I am in favor of this approach. I would like to see some level of abstraction instead of set of |
The api is tricky. I'm basing this on:
The encoder is simpler, as it's already got the I suppose we could split the |
…sues. J2k tests pass, other tests fail
130a12c
to
b152d99
Compare
Ok, I've added some docs for it, with big warnings on the experimental. I'm going to refactor the LibTiff support to use this when I have time, and when I'm doing that, I'll look more closely at the interface. If someone else uses this in the mean time, we'll move them along as the interface moves. |
Fixes the intermittent test failures and occasional dos/thread deadlock in the J2k stack by rewriting the data handling to not use threading.
Changes proposed in this pull request:
Rationale:
It is a relatively common pattern in image libraries to provide a set of read/seek/write functions to the underlying library so that the library can handle pulling/pushing data to a file like object. OpenJpeg does this for the J2k file format, and I worked up a way to do this in the tiff support as well. This additional interface in the C layer allows for a consistent implementation of this core bit of code.
The de/encoder needs to set pushes/pulls_fd =1 from within its initialization routine. If that flag is set, ImageFile.py will call
setfd(self.fd)
and then call the de/encoder routine. At that point, the de/encoder can point (or wrap) any read/seek/write functions at the_imaging_*_pyfd
family of functions which call out to the python file like object. There will be one call to the de/encoder per tile, and the coder will handle any buffer sizes or shuffling within that call. This reduces the complexity of the decoder function, as there is no longer a requirement for multiple calls with additional data to be handled sequentially.ToDo: