mirror of
https://gitee.com/dotnetchina/MiniExcel.git
synced 2024-12-02 03:47:41 +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);
|
ZipArchiveEntry entry = _archive.CreateEntry(path);
|
||||||
using (var zipStream = entry.Open())
|
using (var zipStream = entry.Open())
|
||||||
using (StreamWriter writer = new StreamWriter(zipStream, _utf8WithBom))
|
zipStream.Write(content,0, content.Length);
|
||||||
writer.Write(content);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ namespace MiniExcelLibs.Tests
|
|||||||
[Fact]
|
[Fact]
|
||||||
public void TestIssue304()
|
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 value = Enumerable.Range(1, 5).Select(s => new { image });
|
||||||
var path = PathHelper.GetRandomPath();
|
var path = PathHelper.GetRandomPath();
|
||||||
MiniExcel.SaveAs(path, value);
|
MiniExcel.SaveAs(path, value);
|
||||||
|
Loading…
Reference in New Issue
Block a user