""" Script to create additional PNG icon sizes for better iOS compatibility """ import os from pathlib import Path from PIL import Image def create_icon_sizes(): static_dir = Path("/Users/wn/Workspace/home-automation/apps/ui/static") # Sizes that iOS might need sizes = [16, 32, 57, 60, 72, 76, 114, 120, 144, 152, 180] # Create home icons base_icon = Image.open(static_dir / "apple-touch-icon.png") for size in sizes: resized = base_icon.resize((size, size), Image.Resampling.LANCZOS) resized.save(static_dir / f"apple-touch-icon-{size}x{size}.png") print(f"Created apple-touch-icon-{size}x{size}.png") # Create garage icons garage_icon = Image.open(static_dir / "garage-icon.png") for size in sizes: resized = garage_icon.resize((size, size), Image.Resampling.LANCZOS) resized.save(static_dir / f"garage-icon-{size}x{size}.png") print(f"Created garage-icon-{size}x{size}.png") if __name__ == "__main__": create_icon_sizes()