File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
src/ImageSharp/Processing/Processors/Transforms/Resize Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,18 @@ private static void ApplyNNResizeFrameTransform(
163163 in operation ) ;
164164 }
165165
166+ private static PixelConversionModifiers GetModifiers ( bool compand , bool premultiplyAlpha )
167+ {
168+ if ( premultiplyAlpha )
169+ {
170+ return PixelConversionModifiers . Premultiply . ApplyCompanding ( compand ) ;
171+ }
172+ else
173+ {
174+ return PixelConversionModifiers . None . ApplyCompanding ( compand ) ;
175+ }
176+ }
177+
166178 private static void ApplyResizeFrameTransform (
167179 Configuration configuration ,
168180 ImageFrame < TPixel > source ,
@@ -175,9 +187,7 @@ private static void ApplyResizeFrameTransform(
175187 bool compand ,
176188 bool premultiplyAlpha )
177189 {
178- PixelConversionModifiers conversionModifiers = premultiplyAlpha ?
179- PixelConversionModifiers . Premultiply . ApplyCompanding ( compand ) :
180- PixelConversionModifiers . None . ApplyCompanding ( compand ) ;
190+ PixelConversionModifiers conversionModifiers = GetModifiers ( compand , premultiplyAlpha ) ;
181191
182192 Buffer2DRegion < TPixel > sourceRegion = source . PixelBuffer . GetRegion ( sourceRectangle ) ;
183193
You can’t perform that action at this time.
0 commit comments