mirror of https://github.com/scrapy/scrapy.git
Fix transparency for processed webp images (#5767)
This commit is contained in:
parent
8eb8b23b10
commit
7ae32ea38d
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Reference in New Issue