Skip to content

Commit 8342173

Browse files
authored
Replaced bitmap with skia (#22)
1 parent 966a8a0 commit 8342173

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

SpreadProcessing/CreateModifyExport/CreateModifyExport_NetStandard.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
<Folder Include="Properties\" />
4242
</ItemGroup>
4343
<ItemGroup>
44-
<PackageReference Include="System.Drawing.Common" Version="9.0.0" />
44+
<PackageReference Include="SkiaSharp" Version="3.118.0-preview.2.3" />
45+
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="3.118.0-preview.2.3" />
4546
</ItemGroup>
4647
<ItemGroup>
4748
</ItemGroup>

SpreadProcessing/CreateModifyExport/ImageInfo.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ public class ImageInfo : ImagePropertiesResolverBase
1010
public override Size GetImageSize(byte[] imageData)
1111
{
1212
MemoryStream stream = new MemoryStream(imageData);
13-
using (System.Drawing.Bitmap image = new System.Drawing.Bitmap(stream))
14-
{
15-
return new Size(image.Width, image.Height);
16-
}
13+
14+
SkiaSharp.SKBitmap image = SkiaSharp.SKBitmap.Decode(stream);
15+
return new Size(image.Width, image.Height);
1716
}
1817

1918
public override bool TryGetRawImageData(byte[] imageData, out byte[] rawRgbData, out byte[] rawAlpha, out Size size)

0 commit comments

Comments
 (0)