File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -521,7 +521,7 @@ def test_linear_gradient(self):
521521
522522 # Arrange
523523 target_file = "Tests/images/linear_gradient.png"
524- for mode in ["L" , "P" ]:
524+ for mode in ["L" , "P" , "I" ]:
525525
526526 # Act
527527 im = Image .linear_gradient (mode )
Original file line number Diff line number Diff line change @@ -76,8 +76,17 @@ ImagingFillLinearGradient(const char *mode) {
7676 return NULL ;
7777 }
7878
79- for (y = 0 ; y < 256 ; y ++ ) {
80- memset (im -> image8 [y ], (unsigned char )y , 256 );
79+ if (im -> image8 ) {
80+ for (y = 0 ; y < 256 ; y ++ ) {
81+ memset (im -> image8 [y ], (unsigned char )y , 256 );
82+ }
83+ } else {
84+ int x ;
85+ for (y = 0 ; y < 256 ; y ++ ) {
86+ for (x = 0 ; x < 256 ; x ++ ) {
87+ im -> image32 [y ][x ] = y ;
88+ }
89+ }
8190 }
8291
8392 return im ;
You can’t perform that action at this time.
0 commit comments