-
Notifications
You must be signed in to change notification settings - Fork 171
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
Allow RemoteReader to optionally buffer to memory stream #26
Comments
RemoteReader doesn't provide a seekable stream. That's fine for the default pipeline, which auto-buffers unseekable streams. However, the other pipelines don't have that logic (if I remember right). We can fix this at either end for now. In V4 the framework should probably handle it... |
"The framework" in this case being ImageBuilder.GetStreamFromSource(), which is responsible for turning Streams, IVirtualFiles, and other Stream sources into a Stream? I think I'll start by implementing a fairly standalone SeekableStreamWrapper in the RemoteReader plugin itself, and then we can move it wholesale into the core when we're happy with its behavior. |
Copying wholesale to a MemoryStream is actually fine for now. For our Async work we'll need some sophisticated seekable stream stuff, so that optimization might be better delayed till v4. |
I was thinking about that, having a "buffer-on-the-fly" wrapper, but it seemed like over-engineering for the current uses. (I suppose things like the TIFF decoder might be able to make good use of a 'fetch/cache-on-demand' wrapper, though.) |
…urce stream is wrapped by a seekable helper if it isn't already seekable. Implemented in Core/Util so that (a) it's available to any code with a reference to ImageResizer, (b) it was easy to put tests into Core.Tests, and (c) future enhancements (buffer on-demand, instead of all up-front) can be done in-place without altering calling code. For now, only RemoteReader is making use of the class, but since it's in Core, it can also be used by the ImageResizer framework if desired.
Yeah. Allowing layout & execution plan design to proceed as soon as type & dimensions can be parsed would be useful - especially for tiled, multi-frame, or multi-page images where all the bytes may not be need if there's a smart enough decoder available. |
No description provided.
The text was updated successfully, but these errors were encountered: