GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — mcpproxy-go/scripts/create-ico.py at main · DocSpring/mcpproxy-go

Expand file tree

/

create-ico.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
63 lines (52 loc) · 1.98 KB
/

create-ico.py

Copy path

File metadata and controls

63 lines (52 loc) · 1.98 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env python3
"""
Generate a Windows .ico file from PNG icons for system tray.
This script creates icon-mono-44.ico from existing PNG assets.
"""
from PIL import Image
import os
import sys
def create_ico():
"""Create .ico file from PNG assets."""
script_dir = os.path.dirname(os.path.abspath(__file__))
project_root = os.path.dirname(script_dir)
# Source PNG files (use multiple sizes for better quality)
png_files = [
os.path.join(project_root, 'assets/icons/icon-16.png'),
os.path.join(project_root, 'assets/icons/icon-32.png'),
os.path.join(project_root, 'cmd/mcpproxy-tray/icon-mono-44.png'),
]
# Output ICO file
ico_output = os.path.join(project_root, 'cmd/mcpproxy-tray/icon-mono-44.ico')
# Check if all source files exist
for png_file in png_files:
if not os.path.exists(png_file):
print(f"Error: Source file not found: {png_file}", file=sys.stderr)
return False
try:
# Load all PNG images
images = []
for png_file in png_files:
img = Image.open(png_file)
# Convert to RGBA if needed
if img.mode != 'RGBA':
img = img.convert('RGBA')
images.append(img)
# Save as ICO with multiple sizes
# Windows ICO format supports multiple resolutions in one file
images[0].save(ico_output, format='ICO', sizes=[(16, 16), (32, 32), (44, 44)])
print(f"✅ Successfully created {ico_output}")
# Verify the file was created
if os.path.exists(ico_output):
size = os.path.getsize(ico_output)
print(f" File size: {size} bytes")
return True
else:
print("Error: ICO file was not created", file=sys.stderr)
return False
except Exception as e:
print(f"Error creating ICO file: {e}", file=sys.stderr)
return False
if __name__ == '__main__':
success = create_ico()
sys.exit(0 if success else 1)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.