mirror of
				https://github.com/LonamiWebs/Telethon.git
				synced 2025-10-30 23:47:33 +03:00 
			
		
		
		
	Prevent pillow from closing non-exclusive fps (#1121)
This commit is contained in:
		
							parent
							
								
									ae8f1fed05
								
							
						
					
					
						commit
						fcfebf75a3
					
				|  | @ -44,7 +44,9 @@ def _resize_photo_if_needed( | ||||||
|         file = io.BytesIO(file) |         file = io.BytesIO(file) | ||||||
| 
 | 
 | ||||||
|     try: |     try: | ||||||
|         with PIL.Image.open(file) as image: |         # Don't use a `with` block for `image`, or `file` would be closed. | ||||||
|  |         # See https://github.com/LonamiWebs/Telethon/issues/1121 for more. | ||||||
|  |         image = PIL.Image.open(file) | ||||||
|         if image.width <= width and image.height <= height: |         if image.width <= width and image.height <= height: | ||||||
|             return file |             return file | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user