CSFD integration
This commit is contained in:
19
src/ui/utils.py
Normal file
19
src/ui/utils.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""
|
||||
UI utility functions for Tagger GUI.
|
||||
"""
|
||||
from PIL import Image, ImageTk
|
||||
|
||||
|
||||
def load_icon(path) -> ImageTk.PhotoImage:
|
||||
"""
|
||||
Load an icon from file and resize to 16x16.
|
||||
|
||||
Args:
|
||||
path: Path to the image file
|
||||
|
||||
Returns:
|
||||
ImageTk.PhotoImage resized to 16x16 pixels
|
||||
"""
|
||||
img = Image.open(path)
|
||||
img = img.resize((16, 16), Image.Resampling.LANCZOS)
|
||||
return ImageTk.PhotoImage(img)
|
||||
Reference in New Issue
Block a user