@@ -129,19 +129,35 @@ public void Encode<TPixel>(Image<TPixel> image, Stream stream, CancellationToken
129129
130130        if  ( lossless ) 
131131        { 
132-             using  Vp8LEncoder  encoder  =  new  Vp8LEncoder ( this . memoryAllocator ,  this . configuration ,  image . Width , 
133-                 image . Height ,  this . quality ,  this . skipMetadata ,  this . method ,  this . transparentColorMode , 
134-                 this . nearLossless ,  this . nearLosslessQuality ) ; 
132+             using  Vp8LEncoder  encoder  =  new  Vp8LEncoder ( 
133+                 this . memoryAllocator , 
134+                 this . configuration , 
135+                 image . Width , 
136+                 image . Height , 
137+                 this . quality , 
138+                 this . skipMetadata , 
139+                 this . method , 
140+                 this . transparentColorMode , 
141+                 this . nearLossless , 
142+                 this . nearLosslessQuality ) ; 
135143
136144            bool  hasAnimation  =  image . Frames . Count  >  1 ; 
137145            encoder . EncodeHeader ( image ,  stream ,  hasAnimation ) ; 
138146            if  ( hasAnimation ) 
139147            { 
140148                foreach  ( ImageFrame < TPixel >  imageFrame  in  image . Frames ) 
141149                { 
142-                     using  Vp8LEncoder  enc  =  new  Vp8LEncoder ( this . memoryAllocator ,  this . configuration ,  image . Width , 
143-                         image . Height ,  this . quality ,  this . skipMetadata ,  this . method ,  this . transparentColorMode , 
144-                         this . nearLossless ,  this . nearLosslessQuality ) ; 
150+                     using  Vp8LEncoder  enc  =  new  Vp8LEncoder ( 
151+                         this . memoryAllocator , 
152+                         this . configuration , 
153+                         image . Width , 
154+                         image . Height , 
155+                         this . quality , 
156+                         this . skipMetadata , 
157+                         this . method , 
158+                         this . transparentColorMode , 
159+                         this . nearLossless , 
160+                         this . nearLosslessQuality ) ; 
145161
146162                    enc . Encode ( imageFrame ,  stream ,  true ) ; 
147163                } 
@@ -155,18 +171,36 @@ public void Encode<TPixel>(Image<TPixel> image, Stream stream, CancellationToken
155171        } 
156172        else 
157173        { 
158-             using  Vp8Encoder  encoder  =  new  Vp8Encoder ( this . memoryAllocator ,  this . configuration ,  image . Width , 
159-                 image . Height ,  this . quality ,  this . skipMetadata ,  this . method ,  this . entropyPasses ,  this . filterStrength , 
160-                 this . spatialNoiseShaping ,  this . alphaCompression ) ; 
174+             using  Vp8Encoder  encoder  =  new  Vp8Encoder ( 
175+                 this . memoryAllocator , 
176+                 this . configuration , 
177+                 image . Width , 
178+                 image . Height , 
179+                 this . quality , 
180+                 this . skipMetadata , 
181+                 this . method , 
182+                 this . entropyPasses , 
183+                 this . filterStrength , 
184+                 this . spatialNoiseShaping , 
185+                 this . alphaCompression ) ; 
161186            if  ( image . Frames . Count  >  1 ) 
162187            { 
163188                encoder . EncodeHeader ( image ,  stream ,  false ,  true ) ; 
164189
165190                foreach  ( ImageFrame < TPixel >  imageFrame  in  image . Frames ) 
166191                { 
167-                     using  Vp8Encoder  enc  =  new  Vp8Encoder ( this . memoryAllocator ,  this . configuration ,  image . Width , 
168-                         image . Height ,  this . quality ,  this . skipMetadata ,  this . method ,  this . entropyPasses , 
169-                         this . filterStrength ,  this . spatialNoiseShaping ,  this . alphaCompression ) ; 
192+                     using  Vp8Encoder  enc  =  new  Vp8Encoder ( 
193+                         this . memoryAllocator , 
194+                         this . configuration , 
195+                         image . Width , 
196+                         image . Height , 
197+                         this . quality , 
198+                         this . skipMetadata , 
199+                         this . method , 
200+                         this . entropyPasses , 
201+                         this . filterStrength , 
202+                         this . spatialNoiseShaping , 
203+                         this . alphaCompression ) ; 
170204
171205                    enc . EncodeAnimation ( imageFrame ,  stream ) ; 
172206                } 
0 commit comments