This commit is contained in:
Sarah 2022-09-09 22:42:52 +01:00
parent ead6655b7b
commit 00a50f7ce5
1 changed files with 5 additions and 5 deletions

View File

@ -2,13 +2,12 @@ import base64
from collections import Counter, OrderedDict from collections import Counter, OrderedDict
import csv import csv
import os import os
from wand.image import Image import pyvips
import worldmap import worldmap
import warnings import warnings
from bookstack import Bookstack from bookstack import Bookstack
from vcinema_utils import VCinemaUtils from vcinema_utils import VCinemaUtils
import pyvips
warnings.filterwarnings("ignore") warnings.filterwarnings("ignore")
@ -97,10 +96,11 @@ def draw_map(films_by_country, file_name="vcinema_map.svg"):
image = pyvips.Image.new_from_file(file_name) image = pyvips.Image.new_from_file(file_name)
tn = image.thumbnail_image(1000, crop=pyvips.Interesting.ALL) # Crop image
image = image.thumbnail_image(1000, crop=pyvips.Interesting.ALL)
img = tn.write_to_buffer(".png") png_data = image.write_to_buffer(".png")
os.remove(file_name) os.remove(file_name)
return img return png_data