From cf89f67b0c4205054df1a3c0cb46a718b72149cf Mon Sep 17 00:00:00 2001 From: Lukas Winkler Date: Thu, 3 Oct 2019 20:23:01 +0200 Subject: [PATCH] use python3 for ico detection --- analyseIco.py | 6 +++--- convert.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/analyseIco.py b/analyseIco.py index b53cfdb..7b3c693 100644 --- a/analyseIco.py +++ b/analyseIco.py @@ -19,14 +19,14 @@ import sys file = sys.argv[1] -output = subprocess.check_output("identify " + file, shell=True) +output = subprocess.check_output("identify " + file, shell=True).decode() icons = output.splitlines() -regex = b"\d+x\d+" +regex = r"\d+x\d+" maxsize = 0 maxpos = 0 for i, file_line in enumerate(icons): - resolution = re.findall(regex, file_line)[0].decode() # e.g. 16x16 + resolution = re.findall(regex, file_line)[0] # e.g. 16x16 size = int(resolution.split("x")[0]) # e.g. 16 # "1-bit"-images are not very helpful if size >= maxsize and " 1-bit" not in str(file_line): diff --git a/convert.sh b/convert.sh index 7ff2836..09e6119 100755 --- a/convert.sh +++ b/convert.sh @@ -102,7 +102,7 @@ function handleMultisizeIco () { then mkdir "tmp" fi - largestIcon=$(python analyseIco.py "$1") + largestIcon=$(python3 analyseIco.py "$1") newIcon="tmp/${code}.ico" convert "${i}"\["$largestIcon"\] "$newIcon" echo "$newIcon" # "return"