fix historyDownload generating wrong image size on canvas launch day

This commit is contained in:
HF 2020-11-30 00:39:04 +01:00
parent 56c36b61e6
commit 64d94fb246

View File

@ -86,7 +86,7 @@ async def get_area(canvas, x, y, w, h, start_date, end_date):
iter_date = None iter_date = None
cnt = 0 cnt = 0
#frames = [] #frames = []
previous_day = PIL.Image.new('RGB', (256, 256), color=bkg) previous_day = PIL.Image.new('RGB', (w, h), color=bkg)
while iter_date != end_date: while iter_date != end_date:
iter_date = start_date.strftime("%Y%m%d") iter_date = start_date.strftime("%Y%m%d")
print('------------------------------------------------') print('------------------------------------------------')
@ -174,8 +174,8 @@ if __name__ == "__main__":
end_date = datetime.date.today() end_date = datetime.date.today()
x = int(start[0]) x = int(start[0])
y = int(start[1]) y = int(start[1])
w = int(end[0]) - x w = int(end[0]) - x + 1
h =int( end[1]) - y h = int( end[1]) - y + 1
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
if not os.path.exists('./timelapse'): if not os.path.exists('./timelapse'):
os.mkdir('./timelapse') os.mkdir('./timelapse')