Fix transparency for processed webp images (#5767)

This commit is contained in:
Steve Niafas 2022-12-22 15:33:14 +02:00 committed by GitHub
parent 8eb8b23b10
commit 7ae32ea38d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -171,7 +171,7 @@ class ImagesPipeline(FilesPipeline):
'method called without response_body argument.',
category=ScrapyDeprecationWarning, stacklevel=2)
if image.format == 'PNG' and image.mode == 'RGBA':
if image.format in ('PNG', 'WEBP') and image.mode == 'RGBA':
background = self._Image.new('RGBA', image.size, (255, 255, 255))
background.paste(image, image)
image = background.convert('RGB')