mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 20:04:13 +08:00
(LoadPreviewText): previewed stream should be seekable.
This commit is contained in:
parent
b5fa9cc105
commit
83aafca437
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user