mirror of
https://gitee.com/dotnetchina/MiniExcel.git
synced 2024-11-29 18:38:08 +08:00
Fix : write to zip, the image format error
This commit is contained in:
parent
1069afd726
commit
14ee731b64
@ -200,8 +200,7 @@ namespace MiniExcelLibs.OpenXml
|
||||
{
|
||||
ZipArchiveEntry entry = _archive.CreateEntry(path);
|
||||
using (var zipStream = entry.Open())
|
||||
using (StreamWriter writer = new StreamWriter(zipStream, _utf8WithBom))
|
||||
writer.Write(content);
|
||||
zipStream.Write(content,0, content.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ namespace MiniExcelLibs.Tests
|
||||
[Fact]
|
||||
public void TestIssue304()
|
||||
{
|
||||
var image = Convert.FromBase64String("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQAAAAA3bvkkAAAAEElEQVR4nGJgAQAAAP//AwAABgAFV7+r1AAAAABJRU5ErkJggg==");
|
||||
var image = Convert.FromBase64String("iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=");
|
||||
var value = Enumerable.Range(1, 5).Select(s => new { image });
|
||||
var path = PathHelper.GetRandomPath();
|
||||
MiniExcel.SaveAs(path, value);
|
||||
|
Loading…
Reference in New Issue
Block a user