Skip to content

Commit

Permalink
The convert command is deprecated in IMv7. Use magick convert instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlesage committed Dec 12, 2024
1 parent 1b54032 commit f56c9c1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions helpers/install_app_icon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ install_build_dependencies_alpine() {
if [ -z "$(which curl)" ]; then
INSTALLED_PKGS="$INSTALLED_PKGS curl"
fi
if [ -z "$(which convert)" ]; then
if [ -z "$(which magick)" ]; then
INSTALLED_PKGS="$INSTALLED_PKGS imagemagick"
fi
if [ -z "$(which sed)" ] || ! sed --version | grep -q "(GNU sed)"; then
Expand All @@ -67,7 +67,7 @@ install_build_dependencies_debian() {
if [ -z "$(which curl)" ]; then
INSTALLED_PKGS="$INSTALLED_PKGS curl ca-certificates"
fi
if [ -z "$(which convert)" ]; then
if [ -z "$(which magick)" ]; then
INSTALLED_PKGS="$INSTALLED_PKGS imagemagick"
fi

Expand Down Expand Up @@ -182,14 +182,14 @@ echo "Generating favicons..."
# favicon.ico for legacy browsers.
# ICO can pack files with different resolutions, but it is recommended to stick
# to a single 32x32 image.
convert "$ICONS_DIR"/master_icon.png -define icon:auto-resize=32 -colors 256 "$ICONS_DIR"/favicon.ico
magick convert "$ICONS_DIR"/master_icon.png -define icon:auto-resize=32 -colors 256 "$ICONS_DIR"/favicon.ico

# Web app manifest with 192×192 and 512×512 PNG icons for Android devices.
# The maskable icon should have bigger paddings around the icon so it can be
# cropped by the launcher to fit its design.
convert "$ICONS_DIR"/master_icon.png -resize 192x192 "$ICONS_DIR"/android-chrome-192x192.png
convert "$ICONS_DIR"/master_icon.png -resize 512x512 "$ICONS_DIR"/android-chrome-512x512.png
convert "$ICONS_DIR"/master_icon.png -resize 409x409 -gravity center -background transparent -extent 512x512 "$ICONS_DIR"/android-chrome-512x512-mask.png
magick convert "$ICONS_DIR"/master_icon.png -resize 192x192 "$ICONS_DIR"/android-chrome-192x192.png
magick convert "$ICONS_DIR"/master_icon.png -resize 512x512 "$ICONS_DIR"/android-chrome-512x512.png
magick convert "$ICONS_DIR"/master_icon.png -resize 409x409 -gravity center -background transparent -extent 512x512 "$ICONS_DIR"/android-chrome-512x512-mask.png
cat <<EOF > "$ICONS_DIR"/site.webmanifest
{
"icons": [
Expand All @@ -203,7 +203,7 @@ EOF
# 180×180 PNG image for Apple devices.
# Apple touch icon will look better if a 20px padding around the icon is used
# and add with some background color.
convert "$ICONS_DIR"/master_icon.png -resize 140x140 -gravity center -background transparent -extent 180x180 -background white -alpha remove -alpha off "$ICONS_DIR"/apple-touch-icon.png
magick convert "$ICONS_DIR"/master_icon.png -resize 140x140 -gravity center -background transparent -extent 180x180 -background white -alpha remove -alpha off "$ICONS_DIR"/apple-touch-icon.png

# Create the HTML code to be inserted.
cat <<EOF > "$WORKDIR"/htmlCode
Expand Down

0 comments on commit f56c9c1

Please sign in to comment.