1
0
Fork 0
mirror of https://github.com/matomo-org/matomo-icons.git synced 2024-09-16 13:33:45 +02:00

use python3 for ico detection

This commit is contained in:
Lukas Winkler 2019-10-03 20:23:01 +02:00
parent e439245d51
commit cf89f67b0c
Signed by: lukas
GPG key ID: 54DE4D798D244853
2 changed files with 4 additions and 4 deletions

View file

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

View file

@ -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"