(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
{
file = OpenPreviewStream (preview);
if (!file.CanSeek)
{
var memory = new MemoryStream();
file.CopyTo (memory);
file.Dispose();
file = memory;
}
if (!TextView.IsTextFile (file))
{
ActiveViewer = ImageView;
ResetPreviewPane();
return;
}
var enc = EncodingChoice.SelectedItem as Encoding;