Ports: Simplify the output from identify when installing icons

This ensures that the correct index is always used when selecting an
image of a particular size.
This commit is contained in:
Tim Ledbetter 2023-08-19 00:11:33 +01:00 committed by Tim Schumacher
parent d09271be35
commit 5af7d5da2f
Notes: sideshowbarker 2024-07-17 02:28:18 +09:00

View file

@ -224,7 +224,7 @@ install_icon() {
fi
for icon_size in "16x16" "32x32"; do
index=$(run identify "$icon" | grep "$icon_size" | grep -oE "\[[0-9]+\]" | tr -d "[]" | head -n1)
index=$(run identify -format '%p;%wx%h\n' "$icon" | grep "$icon_size" | cut -d";" -f1 | head -n1)
if [ -n "$index" ]; then
run convert "${icon}[${index}]" "app-${icon_size}.png"
else