From b572e90ef7ff62fb3adc0fefd70c0f4d4a3385c9 Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Wed, 25 Sep 2019 19:36:21 +0200 Subject: [PATCH] [fix]convert bytes to string --- prosopopee/prosopopee.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index 93899be..319e868 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -148,7 +148,7 @@ class Video(object): binary = "avprobe" command = binary + " -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 " + self.base_dir.joinpath(self.name) out = subprocess.check_output(command.split()) - width,height = out.split(',') + width,height = out.decode("utf-8").split(',') return float(width) / int(height) def __repr__(self): @@ -282,7 +282,7 @@ class Image(object): def ratio(self): command = "gm identify -format %w,%h " + self.base_dir.joinpath(self.name) out = subprocess.check_output(command.split()) - width,height = out.split(',') + width,height = out.decode("utf-8").split(',') return float(width) / int(height) def __repr__(self): @@ -540,7 +540,7 @@ def build_gallery(settings, gallery_settings, gallery_path, template): if gallery_settings.get("password") or settings.get("password"): from_template = light_templates.get_template("form.html") html = encrypt(password, light_templates, gallery_light_path, settings, gallery_settings) - + open(Path("build").joinpath(gallery_light_path, "index.html"), "wb").write(html)