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

add icons for referrers (searchEngines and socials)

TODO: Parse html to find favicon in custom path
This commit is contained in:
Lukas Winkler 2016-12-23 14:23:20 +01:00
parent ae39dabd4c
commit d933c3d840
619 changed files with 151 additions and 4 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@
*.log *.log
vendor/ vendor/
tmp tmp
finished.txt

19
analyseIco.py Normal file
View file

@ -0,0 +1,19 @@
import re
import subprocess
import sys
file = sys.argv[1]
output = subprocess.check_output("identify " + file, shell=True)
icons = output.splitlines()
regex = b"\d+x\d+"
maxsize = 0
maxpos = 0
for i, icon in enumerate(icons):
resolution = re.findall(regex, icon)[0].decode() # e.g. 16x16
size = int(resolution.split("x")[0]) # e.g. 16
if size >= maxsize:
maxsize = size
maxpos = i
print(maxpos)

5
composer.json Normal file
View file

@ -0,0 +1,5 @@
{
"require": {
"piwik/searchengine-and-social-list": "^1.3"
}
}

40
composer.lock generated Normal file
View file

@ -0,0 +1,40 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "db041c0dc9f99f4a36466c5d5fff4493",
"packages": [
{
"name": "piwik/searchengine-and-social-list",
"version": "1.3.5",
"source": {
"type": "git",
"url": "https://github.com/piwik/searchengine-and-social-list.git",
"reference": "8302a7414bd48f44916bd4858859607838ac2526"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/piwik/searchengine-and-social-list/zipball/8302a7414bd48f44916bd4858859607838ac2526",
"reference": "8302a7414bd48f44916bd4858859607838ac2526",
"shasum": ""
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"Public Domain"
],
"description": "Search engine and social network definitions used by Piwik",
"time": "2016-11-09T20:36:59+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}

View file

@ -1,20 +1,35 @@
#!/bin/bash #!/bin/bash
shopt -s globstar shopt -s globstar
size=16 size=16
for i in src/**/*.{png,gif,jpg}; do for i in src/**/*.{png,gif,jpg,ico}; do
echo "$i" echo "$i"
absDirname=$(dirname "$i") absDirname=$(dirname "$i")
origFilename=$(basename "$i") origFilename=$(basename "$i")
browserCode=${origFilename%.*} code=${origFilename%.*}
dirname="dist/${absDirname#src/}" dirname="dist/${absDirname#src/}"
distFile="${dirname}/${browserCode}.png" distFile="${dirname}/${code}.png"
echo "$distFile" echo "$distFile"
if [ ! -d "$dirname" ] if [ ! -d "$dirname" ]
then then
mkdir -p "$dirname" mkdir -p "$dirname"
fi fi
if [[ $i == *.ico ]]
then
if file "$i" | grep -E "HTML|empty| data" # if no valid image
then
rm "$i"
else
if [ ! -d "tmp" ]
then
mkdir "tmp"
fi
largestIcon=$(python analyseIco.py "$i")
newIcon="tmp/${code}.ico"
convert ${i}\[$largestIcon\] $newIcon
i=$newIcon
fi
fi
convert \ convert \
"$i" \ "$i" \
-strip \ -strip \
@ -30,6 +45,7 @@ for i in src/**/*.{png,gif,jpg}; do
# make background transparent # make background transparent
# keep transparency # keep transparency
# cut border # cut border
# get only one image from .ico
# resize while keeping the aspect ratio # resize while keeping the aspect ratio
# center image # center image
# fit to 16x16 # fit to 16x16

Binary file not shown.

After

Width:  |  Height:  |  Size: 856 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 860 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,008 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,008 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 943 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Some files were not shown because too many files have changed in this diff Show more