File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/ImageSharp/Formats/Jpeg Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,16 @@ internal sealed unsafe class JpegEncoderCore : IImageEncoderInternals
3333 /// </summary>
3434 private readonly byte [ ] buffer = new byte [ 20 ] ;
3535
36+ /// <summary>
37+ /// The default component id's.
38+ /// </summary>
39+ private static readonly byte [ ] DefaultComponentIds = { 1 , 2 , 3 } ;
40+
41+ /// <summary>
42+ /// Component id's for RGB colorspace.
43+ /// </summary>
44+ private static readonly byte [ ] RgbComponentIds = { 82 , 71 , 66 } ;
45+
3646 /// <summary>
3747 /// The quality, that will be used to encode the image.
3848 /// </summary>
@@ -148,10 +158,10 @@ private byte[] GetComponentIds()
148158 {
149159 if ( this . colorType == JpegColorType . Rgb )
150160 {
151- return new byte [ ] { 82 , 71 , 66 } ;
161+ return RgbComponentIds ;
152162 }
153163
154- return new byte [ ] { 1 , 2 , 3 } ;
164+ return DefaultComponentIds ;
155165 }
156166
157167 /// <summary>
You can’t perform that action at this time.
0 commit comments