Skip to content

Commit 6053eb0

Browse files
committed
release: v2.3
- new parameter to compress images in subdirectories ✨ - accepts spaces in folders/files paths πŸ›
1 parent d6b7867 commit 6053eb0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+626
-458
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 46 additions & 32 deletions
-5.91 MB
Binary file not shown.

β€Žsrc/compress.shβ€Ž

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/zsh
2+
3+
emojis=( "0️⃣" "1️⃣" "2️⃣" "3️⃣" "4️⃣" "5️⃣" "6️⃣" "7️⃣" "8️⃣" "9️⃣" "πŸ”Ÿ" )
4+
echo "πŸ” Depth of the search : Level ${emojis[$level]}\n"
5+
6+
RAW_LINKS=$(echo "$_links_list" | sed 's/ /\ /')
7+
LINKS=(${(s/ /)RAW_LINKS}) # split by tab
8+
9+
IMAGES=()
10+
IFS=$'\n'
11+
12+
for LINK in "${LINKS[@]}"; do
13+
if [ -d "$LINK" ]; then
14+
IMAGES+=($(find -E "$LINK" -maxdepth "$level" -iregex '.*\.(png|jpg|jpeg|tif|tiff|webp)'))
15+
else
16+
IMAGES+=("$LINK")
17+
fi
18+
done
19+
20+
for IMAGE in "${IMAGES[@]}"; do
21+
2>&1 eval "cwebp $_the_preset \"$IMAGE\" -o \"${IMAGE%.*}.webp\""
22+
done

β€Žsrc/filters.shβ€Ž

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/bin/zsh
2+
3+
if [[ $1 = "docs" ]]; then
4+
raw='{
5+
"uid":"Online documention",
6+
"title":"Online documention",
7+
"subtitle":"Open online cwebp documentation",
8+
"arg":"online",
9+
"autocomplete":"Online documention",
10+
"icon": {
11+
"path":"globe-icon.png"
12+
}
13+
}'
14+
json=$(jq '.' ./docs.txt) # to refresh with update_doc.alfredworkflow in dist folder
15+
elif [[ ${1%_*} = "presets" ]]; then
16+
if [[ ${1#*_} = "menu" ]]; then
17+
raw='{
18+
"title":"Add a preset",
19+
"subtitle":"Create a new preset and save it in Alfred app",
20+
"arg":"new",
21+
"autocomplete":"Add a preset",
22+
"icon": {
23+
"path":"CE6A52F7-0196-452F-ACAB-DC1A45F35E0B.png"
24+
}
25+
}
26+
{
27+
"title":"Remove a preset",
28+
"subtitle":"Select the preset you want to remove and press enter",
29+
"arg":"delete",
30+
"autocomplete":"Remove a preset",
31+
"icon": {
32+
"path":"154BFBB1-825A-4E5D-A989-907CC91E90B1.png"
33+
}
34+
}
35+
{
36+
"title":"Modify a preset",
37+
"subtitle":"Select the preset you want to modify and change its value",
38+
"arg":"modify",
39+
"autocomplete":"Modify a preset",
40+
"icon": {
41+
"path":"D0BCADEA-4B48-4681-BF5A-3A99963BCB69.png"
42+
}
43+
}'
44+
elif [[ ${1#*_} = "options" ]]; then
45+
raw='{
46+
"title":"Manual options",
47+
"subtitle":"Run the cwebp compression with your manual input",
48+
"arg":"manual",
49+
"autocomplete":"Manual options",
50+
"icon": {
51+
"path":"36746137-2858-4981-968C-2DDC0B19B7E8.png"
52+
}
53+
}'
54+
else
55+
raw=""
56+
fi
57+
json=$(jq '.' $data_folder/presets.txt)
58+
fi
59+
60+
temp=$(echo "$raw$json")
61+
final=$(jq -s '{items : .}' <<< $temp)
62+
63+
cat << EOB
64+
$final
65+
EOB

β€Žsrc/images/add_preset_1.pngβ€Ž

-96.1 KB
Binary file not shown.

β€Žsrc/images/add_preset_1.webpβ€Ž

36.5 KB

β€Žsrc/images/add_preset_2.pngβ€Ž

-46.2 KB
Binary file not shown.

β€Žsrc/images/add_preset_2.webpβ€Ž

22.3 KB

β€Žsrc/images/add_preset_3.pngβ€Ž

-109 KB
Binary file not shown.

β€Žsrc/images/add_preset_3.webpβ€Ž

38.4 KB

0 commit comments

Comments
Β (0)