increase image size to 48x48
except for smaller images
62
convert.sh
|
@ -1,15 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
shopt -s globstar
|
shopt -s globstar
|
||||||
size=16
|
size=48
|
||||||
|
|
||||||
for i in src/**/*.{png,gif,jpg,ico}; do
|
for i in src/**/*.{png,gif,jpg,ico}; do
|
||||||
echo "$i"
|
|
||||||
absDirname=$(dirname "$i")
|
absDirname=$(dirname "$i")
|
||||||
origFilename=$(basename "$i")
|
origFilename=$(basename "$i")
|
||||||
code=${origFilename%.*}
|
code=${origFilename%.*}
|
||||||
dirname="dist/${absDirname#src/}"
|
dirname="dist/${absDirname#src/}"
|
||||||
distFile="${dirname}/${code}.png"
|
distFile="${dirname}/${code}.png"
|
||||||
echo "$distFile"
|
|
||||||
if [ ! -d "$dirname" ]
|
if [ ! -d "$dirname" ]
|
||||||
then
|
then
|
||||||
mkdir -p "$dirname"
|
mkdir -p "$dirname"
|
||||||
|
@ -33,27 +31,43 @@ for i in src/**/*.{png,gif,jpg,ico}; do
|
||||||
# if file (or symlink) -> didn't get deleted
|
# if file (or symlink) -> didn't get deleted
|
||||||
if [ -e "$i" ]
|
if [ -e "$i" ]
|
||||||
then
|
then
|
||||||
convert \
|
width=$(identify -ping -format "%w" "$i")
|
||||||
"$i" \
|
height=$(identify -ping -format "%h" "$i")
|
||||||
-strip \
|
echo "(${width}x${height})"
|
||||||
-transparent white \
|
if [[ $height -gt $size ]] && [[ $width -gt $size ]]
|
||||||
-background none \
|
then
|
||||||
-trim \
|
convert \
|
||||||
-thumbnail ${size}x${size} \
|
"$i" \
|
||||||
-unsharp 0x1 \
|
-strip \
|
||||||
-gravity center \
|
-transparent white \
|
||||||
-extent ${size}x${size} \
|
-background none \
|
||||||
"$distFile"
|
-trim \
|
||||||
# input file
|
-thumbnail ${size}x${size}\> \
|
||||||
# strip metadata
|
-unsharp 0x1 \
|
||||||
# make background transparent
|
-gravity center \
|
||||||
# keep transparency
|
-extent ${size}x${size} \
|
||||||
# cut border
|
"$distFile"
|
||||||
# get only one image from .ico
|
# input file
|
||||||
# resize while keeping the aspect ratio
|
# strip metadata
|
||||||
# sharpen the image
|
# make background transparent
|
||||||
# center image
|
# keep transparency
|
||||||
# fit to 16x16
|
# cut border
|
||||||
|
# get only one image from .ico
|
||||||
|
# resize while keeping the aspect ratio
|
||||||
|
# sharpen the image
|
||||||
|
# center image
|
||||||
|
# fit to 16x16
|
||||||
|
else
|
||||||
|
convert \
|
||||||
|
"$i" \
|
||||||
|
-strip \
|
||||||
|
-transparent white \
|
||||||
|
-background none \
|
||||||
|
"$distFile"
|
||||||
|
echo -e "\033[31mWarning: This image is smaller than the default size (${width}x${height})"
|
||||||
|
echo -e "$i"
|
||||||
|
echo -e "\033[0m"
|
||||||
|
fi
|
||||||
# optimize png:
|
# optimize png:
|
||||||
pngquant -f --ext .png -s 1 --skip-if-larger --quality 70-95 "$distFile"
|
pngquant -f --ext .png -s 1 --skip-if-larger --quality 70-95 "$distFile"
|
||||||
fi
|
fi
|
||||||
|
|
BIN
dist/DevicePlugins/images/plugins/cookie.png
vendored
Before Width: | Height: | Size: 653 B After Width: | Height: | Size: 2.3 KiB |
BIN
dist/DevicePlugins/images/plugins/director.png
vendored
Before Width: | Height: | Size: 676 B After Width: | Height: | Size: 1.8 KiB |
BIN
dist/DevicePlugins/images/plugins/flash.png
vendored
Before Width: | Height: | Size: 473 B After Width: | Height: | Size: 942 B |
BIN
dist/DevicePlugins/images/plugins/gears.png
vendored
Before Width: | Height: | Size: 799 B After Width: | Height: | Size: 1.2 KiB |
BIN
dist/DevicePlugins/images/plugins/java.png
vendored
Before Width: | Height: | Size: 446 B After Width: | Height: | Size: 1.4 KiB |
BIN
dist/DevicePlugins/images/plugins/pdf.png
vendored
Before Width: | Height: | Size: 754 B After Width: | Height: | Size: 2 KiB |
BIN
dist/DevicePlugins/images/plugins/quicktime.png
vendored
Before Width: | Height: | Size: 907 B After Width: | Height: | Size: 2.7 KiB |
BIN
dist/DevicePlugins/images/plugins/realplayer.png
vendored
Before Width: | Height: | Size: 797 B After Width: | Height: | Size: 2.2 KiB |
BIN
dist/DevicePlugins/images/plugins/silverlight.png
vendored
Before Width: | Height: | Size: 892 B After Width: | Height: | Size: 2.8 KiB |
BIN
dist/DevicePlugins/images/plugins/windowsmedia.png
vendored
Before Width: | Height: | Size: 888 B After Width: | Height: | Size: 3.9 KiB |
BIN
dist/DevicesDetection/images/browsers/36.png
vendored
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 4.8 KiB |
BIN
dist/DevicesDetection/images/browsers/3B.png
vendored
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 4.8 KiB |
BIN
dist/DevicesDetection/images/browsers/AA.png
vendored
Before Width: | Height: | Size: 910 B After Width: | Height: | Size: 2.9 KiB |
BIN
dist/DevicesDetection/images/browsers/AB.png
vendored
Before Width: | Height: | Size: 838 B After Width: | Height: | Size: 673 B |
BIN
dist/DevicesDetection/images/browsers/AG.png
vendored
Before Width: | Height: | Size: 445 B After Width: | Height: | Size: 1.3 KiB |
BIN
dist/DevicesDetection/images/browsers/AM.png
vendored
Before Width: | Height: | Size: 624 B After Width: | Height: | Size: 1.9 KiB |
BIN
dist/DevicesDetection/images/browsers/AN.png
vendored
Before Width: | Height: | Size: 457 B After Width: | Height: | Size: 1.2 KiB |
BIN
dist/DevicesDetection/images/browsers/AO.png
vendored
Before Width: | Height: | Size: 580 B After Width: | Height: | Size: 1.7 KiB |
BIN
dist/DevicesDetection/images/browsers/AR.png
vendored
Before Width: | Height: | Size: 800 B After Width: | Height: | Size: 2.4 KiB |
BIN
dist/DevicesDetection/images/browsers/AT.png
vendored
Before Width: | Height: | Size: 870 B After Width: | Height: | Size: 2.7 KiB |
BIN
dist/DevicesDetection/images/browsers/AV.png
vendored
Before Width: | Height: | Size: 714 B After Width: | Height: | Size: 2.1 KiB |
BIN
dist/DevicesDetection/images/browsers/AW.png
vendored
Before Width: | Height: | Size: 570 B After Width: | Height: | Size: 1.9 KiB |
BIN
dist/DevicesDetection/images/browsers/BB.png
vendored
Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 1.2 KiB |
BIN
dist/DevicesDetection/images/browsers/BD.png
vendored
Before Width: | Height: | Size: 943 B After Width: | Height: | Size: 2.9 KiB |
BIN
dist/DevicesDetection/images/browsers/BE.png
vendored
Before Width: | Height: | Size: 785 B After Width: | Height: | Size: 2.3 KiB |
BIN
dist/DevicesDetection/images/browsers/BJ.png
vendored
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 1.4 KiB |
BIN
dist/DevicesDetection/images/browsers/BK.png
vendored
Before Width: | Height: | Size: 540 B After Width: | Height: | Size: 1.4 KiB |
BIN
dist/DevicesDetection/images/browsers/BL.png
vendored
Before Width: | Height: | Size: 602 B After Width: | Height: | Size: 2 KiB |
BIN
dist/DevicesDetection/images/browsers/BR.png
vendored
Before Width: | Height: | Size: 585 B After Width: | Height: | Size: 1.9 KiB |
BIN
dist/DevicesDetection/images/browsers/BS.png
vendored
Before Width: | Height: | Size: 943 B After Width: | Height: | Size: 2.9 KiB |
BIN
dist/DevicesDetection/images/browsers/BX.png
vendored
Before Width: | Height: | Size: 412 B After Width: | Height: | Size: 405 B |
BIN
dist/DevicesDetection/images/browsers/CA.png
vendored
Before Width: | Height: | Size: 650 B After Width: | Height: | Size: 2.1 KiB |
BIN
dist/DevicesDetection/images/browsers/CC.png
vendored
Before Width: | Height: | Size: 532 B After Width: | Height: | Size: 1.7 KiB |
BIN
dist/DevicesDetection/images/browsers/CD.png
vendored
Before Width: | Height: | Size: 957 B After Width: | Height: | Size: 2.8 KiB |
BIN
dist/DevicesDetection/images/browsers/CF.png
vendored
Before Width: | Height: | Size: 797 B After Width: | Height: | Size: 2.2 KiB |
BIN
dist/DevicesDetection/images/browsers/CH.png
vendored
Before Width: | Height: | Size: 797 B After Width: | Height: | Size: 2.2 KiB |
BIN
dist/DevicesDetection/images/browsers/CI.png
vendored
Before Width: | Height: | Size: 797 B After Width: | Height: | Size: 2.2 KiB |
BIN
dist/DevicesDetection/images/browsers/CK.png
vendored
Before Width: | Height: | Size: 829 B After Width: | Height: | Size: 4.3 KiB |
BIN
dist/DevicesDetection/images/browsers/CM.png
vendored
Before Width: | Height: | Size: 797 B After Width: | Height: | Size: 2.2 KiB |
BIN
dist/DevicesDetection/images/browsers/CN.png
vendored
Before Width: | Height: | Size: 978 B After Width: | Height: | Size: 5.2 KiB |
BIN
dist/DevicesDetection/images/browsers/CO.png
vendored
Before Width: | Height: | Size: 938 B After Width: | Height: | Size: 2.6 KiB |
BIN
dist/DevicesDetection/images/browsers/CP.png
vendored
Before Width: | Height: | Size: 978 B After Width: | Height: | Size: 5.2 KiB |
BIN
dist/DevicesDetection/images/browsers/CR.png
vendored
Before Width: | Height: | Size: 759 B After Width: | Height: | Size: 2.1 KiB |
BIN
dist/DevicesDetection/images/browsers/DE.png
vendored
Before Width: | Height: | Size: 914 B After Width: | Height: | Size: 2.7 KiB |
BIN
dist/DevicesDetection/images/browsers/DF.png
vendored
Before Width: | Height: | Size: 638 B After Width: | Height: | Size: 2 KiB |
BIN
dist/DevicesDetection/images/browsers/DI.png
vendored
Before Width: | Height: | Size: 906 B After Width: | Height: | Size: 5.3 KiB |
BIN
dist/DevicesDetection/images/browsers/EL.png
vendored
Before Width: | Height: | Size: 852 B After Width: | Height: | Size: 2.3 KiB |
BIN
dist/DevicesDetection/images/browsers/EP.png
vendored
Before Width: | Height: | Size: 917 B After Width: | Height: | Size: 2.7 KiB |
BIN
dist/DevicesDetection/images/browsers/ES.png
vendored
Before Width: | Height: | Size: 378 B After Width: | Height: | Size: 343 B |
BIN
dist/DevicesDetection/images/browsers/FB.png
vendored
Before Width: | Height: | Size: 610 B After Width: | Height: | Size: 2 KiB |
BIN
dist/DevicesDetection/images/browsers/FD.png
vendored
Before Width: | Height: | Size: 907 B After Width: | Height: | Size: 5 KiB |
BIN
dist/DevicesDetection/images/browsers/FE.png
vendored
Before Width: | Height: | Size: 702 B After Width: | Height: | Size: 2.4 KiB |
BIN
dist/DevicesDetection/images/browsers/FF.png
vendored
Before Width: | Height: | Size: 973 B After Width: | Height: | Size: 4.7 KiB |
BIN
dist/DevicesDetection/images/browsers/FL.png
vendored
Before Width: | Height: | Size: 688 B After Width: | Height: | Size: 2 KiB |
BIN
dist/DevicesDetection/images/browsers/FN.png
vendored
Before Width: | Height: | Size: 977 B After Width: | Height: | Size: 5.9 KiB |
BIN
dist/DevicesDetection/images/browsers/FW.png
vendored
Before Width: | Height: | Size: 896 B After Width: | Height: | Size: 2.7 KiB |
BIN
dist/DevicesDetection/images/browsers/GA.png
vendored
Before Width: | Height: | Size: 896 B After Width: | Height: | Size: 2.5 KiB |
BIN
dist/DevicesDetection/images/browsers/GE.png
vendored
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 2.4 KiB |
BIN
dist/DevicesDetection/images/browsers/HJ.png
vendored
Before Width: | Height: | Size: 425 B After Width: | Height: | Size: 1.6 KiB |
BIN
dist/DevicesDetection/images/browsers/IA.png
vendored
Before Width: | Height: | Size: 790 B After Width: | Height: | Size: 2.7 KiB |
BIN
dist/DevicesDetection/images/browsers/IB.png
vendored
Before Width: | Height: | Size: 437 B After Width: | Height: | Size: 1.6 KiB |
BIN
dist/DevicesDetection/images/browsers/IC.png
vendored
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 5.2 KiB |
BIN
dist/DevicesDetection/images/browsers/ID.png
vendored
Before Width: | Height: | Size: 797 B After Width: | Height: | Size: 2.6 KiB |
BIN
dist/DevicesDetection/images/browsers/IE.png
vendored
Before Width: | Height: | Size: 910 B After Width: | Height: | Size: 2.4 KiB |
BIN
dist/DevicesDetection/images/browsers/IM.png
vendored
Before Width: | Height: | Size: 571 B After Width: | Height: | Size: 1.8 KiB |
BIN
dist/DevicesDetection/images/browsers/IR.png
vendored
Before Width: | Height: | Size: 972 B After Width: | Height: | Size: 2.6 KiB |
BIN
dist/DevicesDetection/images/browsers/IV.png
vendored
Before Width: | Height: | Size: 529 B After Width: | Height: | Size: 1.9 KiB |
BIN
dist/DevicesDetection/images/browsers/IW.png
vendored
Before Width: | Height: | Size: 892 B After Width: | Height: | Size: 4.8 KiB |
BIN
dist/DevicesDetection/images/browsers/JI.png
vendored
Before Width: | Height: | Size: 780 B After Width: | Height: | Size: 2.6 KiB |
BIN
dist/DevicesDetection/images/browsers/JS.png
vendored
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 1.1 KiB |
BIN
dist/DevicesDetection/images/browsers/KI.png
vendored
Before Width: | Height: | Size: 297 B After Width: | Height: | Size: 612 B |
BIN
dist/DevicesDetection/images/browsers/KM.png
vendored
Before Width: | Height: | Size: 1,008 B After Width: | Height: | Size: 2.6 KiB |
BIN
dist/DevicesDetection/images/browsers/KO.png
vendored
Before Width: | Height: | Size: 993 B After Width: | Height: | Size: 5.5 KiB |
BIN
dist/DevicesDetection/images/browsers/KP.png
vendored
Before Width: | Height: | Size: 738 B After Width: | Height: | Size: 713 B |
BIN
dist/DevicesDetection/images/browsers/KY.png
vendored
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 2.6 KiB |
BIN
dist/DevicesDetection/images/browsers/KZ.png
vendored
Before Width: | Height: | Size: 269 B After Width: | Height: | Size: 1.1 KiB |
BIN
dist/DevicesDetection/images/browsers/LB.png
vendored
Before Width: | Height: | Size: 830 B After Width: | Height: | Size: 2.7 KiB |
BIN
dist/DevicesDetection/images/browsers/LG.png
vendored
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 2.5 KiB |
BIN
dist/DevicesDetection/images/browsers/LI.png
vendored
Before Width: | Height: | Size: 431 B After Width: | Height: | Size: 349 B |
BIN
dist/DevicesDetection/images/browsers/LS.png
vendored
Before Width: | Height: | Size: 758 B After Width: | Height: | Size: 737 B |
BIN
dist/DevicesDetection/images/browsers/LX.png
vendored
Before Width: | Height: | Size: 485 B After Width: | Height: | Size: 1.5 KiB |
BIN
dist/DevicesDetection/images/browsers/MB.png
vendored
Before Width: | Height: | Size: 758 B After Width: | Height: | Size: 3.9 KiB |
BIN
dist/DevicesDetection/images/browsers/MC.png
vendored
Before Width: | Height: | Size: 809 B After Width: | Height: | Size: 2.2 KiB |
BIN
dist/DevicesDetection/images/browsers/ME.png
vendored
Before Width: | Height: | Size: 861 B After Width: | Height: | Size: 2.3 KiB |
BIN
dist/DevicesDetection/images/browsers/MF.png
vendored
Before Width: | Height: | Size: 876 B After Width: | Height: | Size: 2.6 KiB |
BIN
dist/DevicesDetection/images/browsers/MI.png
vendored
Before Width: | Height: | Size: 405 B After Width: | Height: | Size: 867 B |
BIN
dist/DevicesDetection/images/browsers/MS.png
vendored
Before Width: | Height: | Size: 980 B After Width: | Height: | Size: 4.5 KiB |
BIN
dist/DevicesDetection/images/browsers/MU.png
vendored
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 4.8 KiB |
BIN
dist/DevicesDetection/images/browsers/MX.png
vendored
Before Width: | Height: | Size: 676 B After Width: | Height: | Size: 1.5 KiB |
BIN
dist/DevicesDetection/images/browsers/NB.png
vendored
Before Width: | Height: | Size: 892 B After Width: | Height: | Size: 2.2 KiB |
BIN
dist/DevicesDetection/images/browsers/NF.png
vendored
Before Width: | Height: | Size: 553 B After Width: | Height: | Size: 482 B |
BIN
dist/DevicesDetection/images/browsers/NL.png
vendored
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 5.5 KiB |
BIN
dist/DevicesDetection/images/browsers/NO.png
vendored
Before Width: | Height: | Size: 892 B After Width: | Height: | Size: 2.2 KiB |
BIN
dist/DevicesDetection/images/browsers/NP.png
vendored
Before Width: | Height: | Size: 673 B After Width: | Height: | Size: 556 B |
BIN
dist/DevicesDetection/images/browsers/NS.png
vendored
Before Width: | Height: | Size: 704 B After Width: | Height: | Size: 2.2 KiB |
BIN
dist/DevicesDetection/images/browsers/NV.png
vendored
Before Width: | Height: | Size: 892 B After Width: | Height: | Size: 2.2 KiB |
BIN
dist/DevicesDetection/images/browsers/OB.png
vendored
Before Width: | Height: | Size: 770 B After Width: | Height: | Size: 3.1 KiB |
BIN
dist/DevicesDetection/images/browsers/OE.png
vendored
Before Width: | Height: | Size: 784 B After Width: | Height: | Size: 4.1 KiB |
BIN
dist/DevicesDetection/images/browsers/OF.png
vendored
Before Width: | Height: | Size: 419 B After Width: | Height: | Size: 1 KiB |