11// Copyright (c) Six Labors.
22// Licensed under the Six Labors Split License.
33
4+ #if OS_WINDOWS
45using System . Drawing . Imaging ;
56using BenchmarkDotNet . Attributes ;
67using SixLabors . ImageSharp . Formats . Gif ;
@@ -16,12 +17,12 @@ namespace SixLabors.ImageSharp.Benchmarks.Codecs;
1617public class EncodeGif
1718{
1819 // System.Drawing needs this.
19- private Stream bmpStream ;
20+ private FileStream bmpStream ;
2021 private SDImage bmpDrawing ;
2122 private Image < Rgba32 > bmpCore ;
2223
2324 // Try to get as close to System.Drawing's output as possible
24- private readonly GifEncoder encoder = new GifEncoder
25+ private readonly GifEncoder encoder = new ( )
2526 {
2627 Quantizer = new WebSafePaletteQuantizer ( new QuantizerOptions { Dither = KnownDitherings . Bayer4x4 } )
2728 } ;
@@ -53,14 +54,15 @@ public void Cleanup()
5354 [ Benchmark ( Baseline = true , Description = "System.Drawing Gif" ) ]
5455 public void GifSystemDrawing ( )
5556 {
56- using var memoryStream = new MemoryStream ( ) ;
57+ using MemoryStream memoryStream = new ( ) ;
5758 this . bmpDrawing . Save ( memoryStream , ImageFormat . Gif ) ;
5859 }
5960
6061 [ Benchmark ( Description = "ImageSharp Gif" ) ]
6162 public void GifImageSharp ( )
6263 {
63- using var memoryStream = new MemoryStream ( ) ;
64+ using MemoryStream memoryStream = new ( ) ;
6465 this . bmpCore . SaveAsGif ( memoryStream , this . encoder ) ;
6566 }
6667}
68+ #endif
0 commit comments