#!/usr/bin/env python3 """ Created: 2026-06-02 Updated: 2026-06-02 Name: check_icon_sizes.py Desc: Check actual sizes of all platform icons """ from PIL import Image import os BASE = '/Users/wushu/Documents/trae_projects/project/xianyan' # iOS icons ios_dir = os.path.join(BASE, 'ios/Runner/Assets.xcassets/AppIcon.appiconset') print('=== iOS Runner AppIcon ===') for f in sorted(os.listdir(ios_dir)): if f.endswith('.png'): img = Image.open(os.path.join(ios_dir, f)) print(f' {f}: {img.size[0]}x{img.size[1]}') # iOS Widget icons widget_dir = os.path.join(BASE, 'ios/XianyanWidget/Assets.xcassets/AppIcon.appiconset') print('\n=== iOS Widget AppIcon ===') for f in sorted(os.listdir(widget_dir)): if f.endswith('.png'): img = Image.open(os.path.join(widget_dir, f)) print(f' {f}: {img.size[0]}x{img.size[1]}') # macOS icons macos_dir = os.path.join(BASE, 'macos/Runner/Assets.xcassets/AppIcon.appiconset') print('\n=== macOS AppIcon ===') for f in sorted(os.listdir(macos_dir)): if f.endswith('.png'): img = Image.open(os.path.join(macos_dir, f)) print(f' {f}: {img.size[0]}x{img.size[1]}') # Android icons print('\n=== Android mipmap ===') for density in ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi', 'xxxhdpi']: d = os.path.join(BASE, f'android/app/src/main/res/mipmap-{density}') if os.path.exists(d): for f in os.listdir(d): if f.endswith('.png'): img = Image.open(os.path.join(d, f)) print(f' mipmap-{density}/{f}: {img.size[0]}x{img.size[1]}') # OHOS icons print('\n=== OHOS icons ===') ohos_paths = [ 'ohos/AppScope/resources/base/media/app_icon.png', 'ohos/AppScope/resources/base/media/foreground_icon.png', 'ohos/entry/src/main/resources/base/media/icon.png', 'ohos/entry/src/main/resources/base/media/foreground_icon.png', ] for p in ohos_paths: full = os.path.join(BASE, p) if os.path.exists(full): img = Image.open(full) print(f' {p}: {img.size[0]}x{img.size[1]}') else: print(f' {p}: NOT FOUND')