(LoadPreviewText): previewed stream should be seekable.

This commit is contained in:
morkt 2015-05-12 13:58:19 +04:00
parent b5fa9cc105
commit 83aafca437

View File

@ -209,9 +209,16 @@ namespace GARbro.GUI
try try
{ {
file = OpenPreviewStream (preview); file = OpenPreviewStream (preview);
if (!file.CanSeek)
{
var memory = new MemoryStream();
file.CopyTo (memory);
file.Dispose();
file = memory;
}
if (!TextView.IsTextFile (file)) if (!TextView.IsTextFile (file))
{ {
ActiveViewer = ImageView; ResetPreviewPane();
return; return;
} }
var enc = EncodingChoice.SelectedItem as Encoding; var enc = EncodingChoice.SelectedItem as Encoding;