Skip to content

Commit

Permalink
add icon process script
Browse files Browse the repository at this point in the history
  • Loading branch information
git committed Sep 21, 2024
1 parent 52bc899 commit cc8379a
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 0 deletions.
Binary file modified electron/resources/build/appx/Square150x150Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified electron/resources/build/appx/Square44x44Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified electron/resources/build/appx/StoreLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified electron/resources/build/appx/Wide310x150Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified electron/resources/build/logo.icns
Binary file not shown.
Binary file modified electron/resources/build/logo.ico
Binary file not shown.
Binary file modified electron/resources/build/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
46 changes: 46 additions & 0 deletions scripts/icon_convert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

# prepare
# brew install --cask inkscape

# get current script directory
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

path_build="${DIR}/../electron/resources/build"
path_source_png="${path_build}/logo_1024x1024.png"

size=(16 32 44 48 64 128 150 256 512)
for i in "${size[@]}"; do
path_png="${path_build}/logo@${i}x$i.png"
echo "Generated: logo@${i}x$i.png"
inkscape --export-type="png" --export-filename="${path_png}" -w $i -h $i "${path_source_png}"
done

path_ico="${path_build}/logo.ico"
echo "Generated: logo.ico"
magick "${path_source_png}" -define icon:auto-resize=256,48,32,16 "${path_ico}"

echo "Generated: logo.png"
rm -rf "${path_build}/logo.png"
cp -a "${path_build}/[email protected]" "${path_build}/logo.png"

echo "Generated: logo.icns"
path_iconset="${path_build}/icon.iconset"
rm -rf "${path_iconset}"
mkdir -p "${path_iconset}"
cp -a "${path_build}/[email protected]" "${path_iconset}/icon_256x256.png"
cp -a "${path_build}/[email protected]" "${path_iconset}/icon_32x32.png"
cp -a "${path_build}/[email protected]" "${path_iconset}/icon_16x16.png"
iconutil -c icns "${path_iconset}" -o "${path_build}/logo.icns"

echo "Generated: appx/StoreLogo.png"
cp -a "${path_build}/[email protected]" "${path_build}/appx/StoreLogo.png"
echo "Generated: appx/Square44x44Logo.png"
cp -a "${path_build}/[email protected]" "${path_build}/appx/Square44x44Logo.png"
echo "Generated: appx/Square150x150Logo.png"
cp -a "${path_build}/[email protected]" "${path_build}/appx/Square150x150Logo.png"
echo "Generated: appx/Wide310x150Logo.png"
magick "${path_build}/[email protected]" -resize 310x150 -background none -gravity center -extent 310x150 "${path_build}/appx/Wide310x150Logo.png"

rm -rf "${path_iconset}"
rm -rf ${path_build}/logo@*

0 comments on commit cc8379a

Please sign in to comment.