From 83aafca437cbec1f0d6d245b5a72192874d29108 Mon Sep 17 00:00:00 2001 From: morkt Date: Tue, 12 May 2015 13:58:19 +0400 Subject: [PATCH] (LoadPreviewText): previewed stream should be seekable. --- ImagePreview.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ImagePreview.cs b/ImagePreview.cs index b9e40184..21cfbf49 100644 --- a/ImagePreview.cs +++ b/ImagePreview.cs @@ -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;