Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better space handling, and a transparent DEBUG banner to create overlays #7922

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added scripts/osx/OF_debug_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 50 additions & 14 deletions scripts/osx/build_iconset.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,16 +1,52 @@
#!/bin/bash

# usage is: build_iconset.sh <path_to_1024x1024_PNG>
# scripts creates .icns beside the original PNG
# if orig PNG is not 1024x1024 it will get stretched/compressed
# if you have imagemagick install you get a free debug icon

IFS='.' read -ra ADDR <<< "$1"
ICONSET=${ADDR[0]}.iconset
mkdir $ICONSET
sips -z 16 16 $1 --out $ICONSET/icon_16x16.png
sips -z 32 32 $1 --out $ICONSET/[email protected]
sips -z 32 32 $1 --out $ICONSET/icon_32x32.png
sips -z 64 64 $1 --out $ICONSET/[email protected]
sips -z 128 128 $1 --out $ICONSET/icon_128x128.png
sips -z 256 256 $1 --out $ICONSET/[email protected]
sips -z 256 256 $1 --out $ICONSET/icon_256x256.png
sips -z 512 512 $1 --out $ICONSET/[email protected]
sips -z 512 512 $1 --out $ICONSET/icon_512x512.png
cp $1 $ICONSET/[email protected]
iconutil -c icns $ICONSET
rm -R $ICONSET
ICONSET="${ADDR[0]}.iconset"
mkdir "$ICONSET"
sips -z 16 16 "$1" --out "$ICONSET/icon_16x16.png"
sips -z 32 32 "$1" --out "$ICONSET/[email protected]"
sips -z 32 32 "$1" --out "$ICONSET/icon_32x32.png"
sips -z 64 64 "$1" --out "$ICONSET/[email protected]"
sips -z 128 128 "$1" --out "$ICONSET/icon_128x128.png"
sips -z 256 256 "$1" --out "$ICONSET/[email protected]"
sips -z 256 256 "$1" --out "$ICONSET/icon_256x256.png"
sips -z 512 512 "$1" --out "$ICONSET/[email protected]"
sips -z 512 512 "$1" --out "$ICONSET/icon_512x512.png"
sips -z 1024 1024 "$1" --out "$ICONSET/[email protected]"
##cp "$1" "$ICONSET/[email protected]"
iconutil -c icns "$ICONSET"
rm -R "$ICONSET"
echo "plain icon done"

if ! command -v magick &> /dev/null
then
echo "brew install imagemagick to generate a debug icon overlay"
exit 1
else
THE_SCRIPT_DIR=`dirname "$0"`
echo "${THE_SCRIPT_DIR}"
DEBUG_PNG="${ADDR[0]}_debug.png"
magick composite -verbose -gravity center "${THE_SCRIPT_DIR}/OF_debug_overlay.png" "$1" "${DEBUG_PNG}"
ICONSET="${ADDR[0]}_debug.iconset"
mkdir "$ICONSET"
sips -z 16 16 "${DEBUG_PNG}" --out "$ICONSET/icon_16x16.png"
sips -z 32 32 "${DEBUG_PNG}" --out "$ICONSET/[email protected]"
sips -z 32 32 "${DEBUG_PNG}" --out "$ICONSET/icon_32x32.png"
sips -z 64 64 "${DEBUG_PNG}" --out "$ICONSET/[email protected]"
sips -z 128 128 "${DEBUG_PNG}" --out "$ICONSET/icon_128x128.png"
sips -z 256 256 "${DEBUG_PNG}" --out "$ICONSET/[email protected]"
sips -z 256 256 "${DEBUG_PNG}" --out "$ICONSET/icon_256x256.png"
sips -z 512 512 "${DEBUG_PNG}" --out "$ICONSET/[email protected]"
sips -z 512 512 "${DEBUG_PNG}" --out "$ICONSET/icon_512x512.png"
sips -z 1024 1024 "${DEBUG_PNG}" --out "$ICONSET/[email protected]"
###cp "$1" "$ICONSET/[email protected]"
iconutil -c icns "$ICONSET"
rm -R "$ICONSET"
rm "${DEBUG_PNG}"
echo "debug icon done"
fi