bugfix/map-has-no-border #8
|
@ -8,6 +8,7 @@ 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")
|
||||||
|
|
||||||
|
@ -94,9 +95,14 @@ def draw_map(films_by_country, file_name="vcinema_map.svg"):
|
||||||
|
|
||||||
worldmap.plot(countries, cmap=["#FF4000"], opacity=opacity, filename=file_name, verbose=False)
|
worldmap.plot(countries, cmap=["#FF4000"], opacity=opacity, filename=file_name, verbose=False)
|
||||||
|
|
||||||
with Image(filename=file_name, width=1000, height=655) as i:
|
image = pyvips.Image.new_from_file(file_name)
|
||||||
png_data = i.make_blob("png")
|
|
||||||
|
tn = image.thumbnail_image(1000, crop=pyvips.Interesting.ALL)
|
||||||
|
|
||||||
|
img_buffer = tn.write_to_memory()
|
||||||
|
|
||||||
|
img = img_buffer[:]
|
||||||
|
|
||||||
os.remove(file_name)
|
os.remove(file_name)
|
||||||
|
|
||||||
return png_data
|
return img
|
||||||
|
|
Loading…
Reference in New Issue