From 573c1cd990471893a354d1e55fc1890380faa0d5 Mon Sep 17 00:00:00 2001 From: Sarah Date: Fri, 9 Sep 2022 21:42:53 +0100 Subject: [PATCH] make some changes --- get_file.py | 5 ++++- wiki_pages/FilmsByCountry.py | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/get_file.py b/get_file.py index 9dcd496..349a2e6 100644 --- a/get_file.py +++ b/get_file.py @@ -11,4 +11,7 @@ image = pyvips.Image.new_from_file(file) tn = image.thumbnail_image(1000, crop=pyvips.Interesting.ALL) -tn.write_to_file("x.png") \ No newline at end of file +img_buffer = tn.write_to_buffer(".png") + +with open("b.png", "wb") as f: + f.write(img_buffer) diff --git a/wiki_pages/FilmsByCountry.py b/wiki_pages/FilmsByCountry.py index 8fe7282..a3095e7 100644 --- a/wiki_pages/FilmsByCountry.py +++ b/wiki_pages/FilmsByCountry.py @@ -99,9 +99,7 @@ def draw_map(films_by_country, file_name="vcinema_map.svg"): tn = image.thumbnail_image(1000, crop=pyvips.Interesting.ALL) - img_buffer = tn.write_to_memory() - - img = img_buffer[:] + img = tn.write_to_buffer(".png") os.remove(file_name)