Closed michael-fadely closed 7 years ago
Hmm, should it reset the position to 0? I designed it that way so you can easily write to the stream multiple times in a row without having to use a separate stream and writing that data to the stream. Image.Save seems to work this way as well (aside from the fact that you need to start writing at the beginning of the stream), though I haven't tested this.
ToStream on the other hand should reset the position to 0. That's something I need to change.
That's a fair point; maybe not then. It certainly wasn't a straight forward fix for this program of mine, though. It took a while of debugging to figure out what the problem was (although admittedly it shouldn't have, so that's on me).
I'm leaving the Save method as that is (Image.Save works this way too). I changed the stream returned by ToStream to have it's position set to the beginning of the stream.
VrTextureEncoder.Save doesn't reset the destination stream's position to 0, and this will cause .Is() to fail since Length - Position is 0.