Ports: Convert only first index of ico files

When installing an icon, we fall back to a resizing strategy when an
exact match on the image dimensions is missing. However, if we are
dealing with an `.ico` file with multiple indices, `convert` will
resize every separate index and will create multiple files.

This changes makes sure we only resize the first index. A future
improvement could be to select an index most closely matching the
requested dimensions.
This commit is contained in:
Jelle Raaijmakers 2021-08-04 11:20:31 +02:00 committed by Linus Groh
parent 546af2d9ef
commit 8493477cc7
Notes: sideshowbarker 2024-07-18 07:29:50 +09:00

View file

@ -127,7 +127,7 @@ install_icon() {
if [ -n "$index" ]; then
run convert "${icon}[${index}]" "app-${icon_size}.png"
else
run convert "$icon" -resize $icon_size "app-${icon_size}.png"
run convert "$icon[0]" -resize $icon_size "app-${icon_size}.png"
fi
done
run objcopy --add-section serenity_icon_s="app-16x16.png" "${DESTDIR}${launcher}"