1
0
Fork 0
mirror of https://github.com/matomo-org/matomo-icons.git synced 2024-09-19 17:03:45 +02:00

also apply quality check to socials and searchengines

This commit is contained in:
Lukas Winkler 2017-07-06 12:11:52 +02:00
parent 72cbc5a460
commit 2814117e82

View file

@ -97,24 +97,23 @@ def test_if_placeholder_icon_exist():
def test_if_icons_are_large_enough():
# ignore searchEngines and socials
for icontype in ["brand", "browsers", "devices", "flags", "os", "plugins", "SEO"]:
for filetype in ["png", "gif", "jpg", "ico"]:
for source_file in glob("src/{type}/*.{filetype}".format(type=icontype, filetype=filetype)):
im = Image.open(source_file)
if im.size[0] < min_image_size or im.size[1] < min_image_size:
print(
"{file} is smaller ({width}x{height}) that the target size ({target}x{target})".format(
file=source_file,
width=im.size[0],
height=im.size[1],
target=min_image_size
)
)
if filetype in ["jpg", "gif", "ico"]:
print("{file} is saved in a lossy image format ({filetype}). ".format(
for filetype in ["png", "gif", "jpg", "ico"]:
for source_file in glob("src/*/*.{filetype}".format(filetype=filetype)):
im = Image.open(source_file)
if im.size[0] < min_image_size or im.size[1] < min_image_size:
print(
"{file} is smaller ({width}x{height}) that the target size ({target}x{target})".format(
file=source_file,
filetype=filetype
) + "Maybe try to find an PNG or SVG from another source.")
width=im.size[0],
height=im.size[1],
target=min_image_size
)
)
if filetype in ["jpg", "gif", "ico"]:
print("{file} is saved in a lossy image format ({filetype}). ".format(
file=source_file,
filetype=filetype
) + "Maybe try to find an PNG or SVG from another source.")
def test_if_dist_icons_are_square():