mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-10-31 07:57:27 +03:00 
			
		
		
		
	this bug actually was in previous implementation too:
type switch default case was never achieved because special images is in image8 pointers, not in image32
This commit is contained in:
		
							parent
							
								
									24ed800fae
								
							
						
					
					
						commit
						6078e6e1a7
					
				|  | @ -208,7 +208,7 @@ ImagingStretchHorizontal(Imaging imIn, int xsize, int filter) | |||
|                     ss += i2f(imIn->image8[yy][x]) * k[x - xmin]; | ||||
|                 imOut->image8[yy][xx] = clip8(ss); | ||||
|             } | ||||
|         } else | ||||
|         } else { | ||||
|             switch(imIn->type) { | ||||
|             case IMAGING_TYPE_UINT8: | ||||
|                 /* n-bit grayscale */ | ||||
|  | @ -283,12 +283,7 @@ ImagingStretchHorizontal(Imaging imIn, int xsize, int filter) | |||
|                     IMAGING_PIXEL_F(imOut, xx, yy) = ss; | ||||
|                 } | ||||
|                 break; | ||||
|             default: | ||||
|                 ImagingSectionLeave(&cookie); | ||||
|                 ImagingDelete(imOut); | ||||
|                 free(kk); | ||||
|                 free(xbounds); | ||||
|                 return (Imaging) ImagingError_ModeError(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|     ImagingSectionLeave(&cookie); | ||||
|  | @ -307,6 +302,9 @@ ImagingStretch(Imaging imIn, int xsize, int ysize, int filter) | |||
|     if (strcmp(imIn->mode, "P") == 0 || strcmp(imIn->mode, "1") == 0) | ||||
|         return (Imaging) ImagingError_ModeError(); | ||||
| 
 | ||||
|     if (imIn->type == IMAGING_TYPE_SPECIAL) | ||||
|         return (Imaging) ImagingError_ModeError(); | ||||
| 
 | ||||
|     /* two-pass resize, first pass */ | ||||
|     imTemp1 = ImagingStretchHorizontal(imIn, xsize, filter); | ||||
|     if ( ! imTemp1) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user