pyPhotoAlbum/generate_icons.sh
Duncan Tourolle ca21f3ae4c
All checks were successful
Python CI / test (push) Successful in 1m6s
Lint / lint (push) Successful in 1m10s
Tests / test (3.10) (push) Successful in 53s
Tests / test (3.11) (push) Successful in 52s
Tests / test (3.9) (push) Successful in 50s
more tests and gnoem+fedora installer
2025-11-11 12:51:15 +01:00

45 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Generate multiple icon sizes from the source icon for better GNOME integration
set -e
SOURCE_ICON="pyPhotoAlbum/icons/icon.png"
ICONS_DIR="pyPhotoAlbum/icons"
# Check if source icon exists
if [ ! -f "$SOURCE_ICON" ]; then
echo "Error: Source icon not found at $SOURCE_ICON"
exit 1
fi
# Check if ImageMagick is installed
if ! command -v convert &> /dev/null; then
echo "ImageMagick is not installed. Please install it:"
echo " Fedora: sudo dnf install ImageMagick"
echo " Arch/Cachy: sudo pacman -S imagemagick"
echo " Ubuntu: sudo apt install imagemagick"
exit 1
fi
echo "Generating icon sizes for GNOME integration..."
# Standard icon sizes for freedesktop.org icon theme specification
SIZES=(16 22 24 32 48 64 128 256 512)
for size in "${SIZES[@]}"; do
output_file="${ICONS_DIR}/icon-${size}x${size}.png"
echo " Creating ${size}x${size} icon..."
convert "$SOURCE_ICON" -resize "${size}x${size}" "$output_file"
done
# Create scalable SVG if needed (optional)
# This would require inkscape or another tool
echo ""
echo "Icon generation complete!"
echo "Generated icons:"
ls -lh "${ICONS_DIR}"/icon-*.png
echo ""
echo "You can now install these icons using ./install.sh"