[fix]convert bytes to string

This commit is contained in:
Adrien Beudin 2019-09-25 19:36:21 +02:00
parent 86be23bc82
commit b572e90ef7

View File

@ -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):