Notification screenshot/JPEG was not being regenerated correctly (#1149)

This commit is contained in:
dgtlmoon
2022-11-22 18:08:46 +01:00
committed by GitHub
parent 68d5178367
commit ce6c2737a8
3 changed files with 16 additions and 16 deletions

View File

@@ -368,6 +368,12 @@ class ChangeDetectionStore:
f.write(screenshot)
f.close()
# Make a JPEG that's used in notifications (due to being a smaller size) available
from PIL import Image
im1 = Image.open(target_path)
im1.convert('RGB').save(target_path.replace('.png','.jpg'), quality=int(os.getenv("NOTIFICATION_SCREENSHOT_JPG_QUALITY", 75)))
def save_error_text(self, watch_uuid, contents):
if not self.data['watching'].get(watch_uuid):
return