Files
dxdesigner-part-replacement/tools/build_app_icon.py
T
阿白叔 9cb19902d9
Core regression / Python core, intervention UI and release configuration (push) Successful in 3m16s
Core regression / JavaScript syntax (push) Successful in 5s
Core regression / Python core, intervention UI and release configuration (pull_request) Successful in 3m22s
Core regression / JavaScript syntax (pull_request) Successful in 5s
release: prepare v1.3.0 with approved application icon
2026-11-10 10:35:02 +08:00

22 lines
719 B
Python

"""Export the approved PNG master into application and documentation icons."""
from pathlib import Path
from PIL import Image
def main():
root = Path(__file__).resolve().parents[1]
assets = root / 'src/dx_productivity/trial_task_center/assets'
with Image.open(assets / 'app-master.png') as source:
image = source.convert('RGBA')
if image.size != (1024, 1024):
raise ValueError('Application icon master must be 1024x1024')
image.save(assets / 'app.png')
image.save(assets / 'app.ico', sizes=[(n, n) for n in (16, 20, 24, 32, 40, 48, 64, 96, 128, 256)])
image.save(root / 'docs/user/media/app-icon.png')
print(assets / 'app.ico')
if __name__ == '__main__':
main()