wallpaper: add support for WebP format

This commit is contained in:
Vincent Bernat 2021-08-08 15:25:59 +02:00
parent e4a5aa99e8
commit 14d64de364

View file

@ -66,7 +66,7 @@ screens.sort(key=lambda screen: -screen[0] * screen[1])
images = []
for base, _, files in os.walk(os.path.join(options.directory)):
for i in files:
if os.path.splitext(i)[1].lower() in (".jpg", ".jpeg", ".png"):
if os.path.splitext(i)[1].lower() in (".jpg", ".jpeg", ".png", ".webp"):
images.append(os.path.join(base, i))
images = random.sample(images, len(screens))
images = [Image.open(image) for image in images]