Files
ays953andClaude Opus 5.5 e0eecc1eb5 Add Windows version on PIME
Port the core (Zhuyin parser, classifier, converter, composition engine) to
Python as a PIME input method, with the same test cases as the Swift version
plus wrapper tests against stand-in PIME modules. scripts/package-windows.sh
builds a zip with install/uninstall scripts and a README for testers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 14:31:42 +08:00

13 lines
552 B
Python
Executable File

#!/usr/bin/env python3
"""Wraps a PNG into a single-image .ico file. Usage: png_to_ico.py in.png out.ico"""
import struct
import sys
png = open(sys.argv[1], "rb").read()
width, height = struct.unpack(">II", png[16:24])
header = struct.pack("<HHH", 0, 1, 1) # reserved, type=icon, count
entry = struct.pack("<BBBBHHII",
width % 256, height % 256, 0, 0, # 0 means 256
1, 32, len(png), 6 + 16) # planes, bpp, size, offset
open(sys.argv[2], "wb").write(header + entry + png)