Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Unnecessary file output to post-process still captures #188

Open
MV10 opened this issue Oct 11, 2020 · 0 comments
Open

Unnecessary file output to post-process still captures #188

MV10 opened this issue Oct 11, 2020 · 0 comments

Comments

@MV10
Copy link
Collaborator

MV10 commented Oct 11, 2020

This is another spinoff from PR #175.

While testing those changes, I was surprised to see my "jpg" file on ramdisk briefly jump to the raw data's 3.5MB size, then drop to the 200K JPEG size.

This is due to ImageStreamCaptureHandler and the underlying stream base class writing image data to the stream in Process, then copying it back to memory in PostProcess to invoke OnManipulate. The initial output seems like unnecessary overhead. It's trivial in my ramdisk scenario, but it would make a bigger difference on slower physical media (especially SD cards).

It seems to me that if Manipulate is called with a target ImageFormat, we need sort of a hybrid of InMemoryCaptureHandler Process to accumulate image data in memory, and the output stage of StreamCaptureHandler PostProcess to invoke manipulation and write the results to a pathname. (In fact, maybe it should work the same way even when ImageFormat is null. Then you'd be storing a raw file.)

I'm not sure of the best way to resolve this, but after thinking about it more, it didn't really belong in that PR.

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

No branches or pull requests

1 participant