Skip to content
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

Closed
lilith opened this issue Feb 4, 2013 · 5 comments
Closed

Allow RemoteReader to optionally buffer to memory stream #26

lilith opened this issue Feb 4, 2013 · 5 comments
Assignees
Milestone

Comments

@lilith
Copy link
Member

lilith commented Feb 4, 2013

No description provided.

@lilith
Copy link
Member Author

lilith commented Nov 27, 2013

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...

@ghost ghost assigned JaredReisinger Nov 27, 2013
@JaredReisinger
Copy link
Contributor

"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.

@lilith
Copy link
Member Author

lilith commented Dec 12, 2013

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.

@JaredReisinger
Copy link
Contributor

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.)

JaredReisinger added a commit that referenced this issue Dec 13, 2013
…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.
@lilith
Copy link
Member Author

lilith commented Dec 13, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants