Compare commits
No commits in common. "ed07915a4dbc51e0daafd8737641d3a66f210680" and "35d3637cd987a9fd27c960b309afa46cc7f5130d" have entirely different histories.
ed07915a4d
...
35d3637cd9
14
get_file.py
14
get_file.py
@ -1,14 +0,0 @@
|
||||
import base64
|
||||
from svglib.svglib import svg2rlg
|
||||
from reportlab.graphics import renderPDF, renderPM
|
||||
import cairosvg
|
||||
|
||||
file = "vcinema_map.svg"
|
||||
|
||||
import pyvips
|
||||
|
||||
image = pyvips.Image.new_from_file(file)
|
||||
|
||||
tn = image.thumbnail_image(1000, crop=pyvips.Interesting.ALL)
|
||||
|
||||
tn.write_to_file("x.png")
|
@ -8,7 +8,6 @@ import warnings
|
||||
|
||||
from bookstack import Bookstack
|
||||
from vcinema_utils import VCinemaUtils
|
||||
import pyvips
|
||||
|
||||
warnings.filterwarnings("ignore")
|
||||
|
||||
@ -95,14 +94,9 @@ def draw_map(films_by_country, file_name="vcinema_map.svg"):
|
||||
|
||||
worldmap.plot(countries, cmap=["#FF4000"], opacity=opacity, filename=file_name, verbose=False)
|
||||
|
||||
image = pyvips.Image.new_from_file(file_name)
|
||||
|
||||
tn = image.thumbnail_image(1000, crop=pyvips.Interesting.ALL)
|
||||
|
||||
img_buffer = tn.write_to_memory()
|
||||
|
||||
img = img_buffer[:]
|
||||
with Image(filename=file_name, width=1000, height=655) as i:
|
||||
png_data = i.make_blob("png")
|
||||
|
||||
os.remove(file_name)
|
||||
|
||||
return img
|
||||
return png_data
|
||||
|
Loading…
x
Reference in New Issue
Block a user