Files
Flobidian/md_viewer/static/icon_maker.py
T
nahakubuilde 3e4355d20d Fix issue with picture upload and rendering based on 4 modes how Obsidian can store images.
Add there option to view other files and uplod/download files from main view
2025-06-28 12:41:34 +01:00

9 lines
373 B
Python

from pathlib import Path
from PIL import Image
src_path = Path("notes_app.png")
dst_path = Path("favicon.ico")
with Image.open(src_path) as img:
img = img.convert("RGBA")
icon_sizes = [(32, 32), (128, 128), (256, 256)]
resized_images = [img.resize(size, Image.LANCZOS) for size in icon_sizes]
resized_images[0].save(dst_path, format='ICO', sizes=icon_sizes)