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:
parent
72cbc5a460
commit
2814117e82
1 changed files with 16 additions and 17 deletions
33
tests.py
33
tests.py
|
@ -97,24 +97,23 @@ def test_if_placeholder_icon_exist():
|
||||||
|
|
||||||
def test_if_icons_are_large_enough():
|
def test_if_icons_are_large_enough():
|
||||||
# ignore searchEngines and socials
|
# ignore searchEngines and socials
|
||||||
for icontype in ["brand", "browsers", "devices", "flags", "os", "plugins", "SEO"]:
|
for filetype in ["png", "gif", "jpg", "ico"]:
|
||||||
for filetype in ["png", "gif", "jpg", "ico"]:
|
for source_file in glob("src/*/*.{filetype}".format(filetype=filetype)):
|
||||||
for source_file in glob("src/{type}/*.{filetype}".format(type=icontype, filetype=filetype)):
|
im = Image.open(source_file)
|
||||||
im = Image.open(source_file)
|
if im.size[0] < min_image_size or im.size[1] < min_image_size:
|
||||||
if im.size[0] < min_image_size or im.size[1] < min_image_size:
|
print(
|
||||||
print(
|
"{file} is smaller ({width}x{height}) that the target size ({target}x{target})".format(
|
||||||
"{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(
|
|
||||||
file=source_file,
|
file=source_file,
|
||||||
filetype=filetype
|
width=im.size[0],
|
||||||
) + "Maybe try to find an PNG or SVG from another source.")
|
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():
|
def test_if_dist_icons_are_square():
|
||||||
|
|
Loading…
Reference in a new issue