mirror of
https://gitlab.com/square-game-liberation-front/F.E.I.S.git
synced 2025-02-28 23:41:33 +01:00
move to imagemagick to convert icon
This commit is contained in:
parent
6d0d225b82
commit
79de731c0d
@ -1,15 +0,0 @@
|
||||
import argparse
|
||||
from io import BytesIO
|
||||
from pathlib import Path
|
||||
|
||||
import cairosvg
|
||||
from PIL import Image
|
||||
|
||||
parser = argparse.ArgumentParser(description="Render the given .svg file to a windows .ico file")
|
||||
parser.add_argument("svg", type=Path)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
png_data = BytesIO(cairosvg.svg2png(url=str(args.svg), parent_height=256, parent_width=256))
|
||||
image = Image.open(png_data, formats=["PNG"])
|
||||
image.save(args.svg.with_suffix(".ico"), format="ICO")
|
14
utils/render_windows_icon.sh
Executable file
14
utils/render_windows_icon.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (( $# < 1 )); then
|
||||
echo "usage : $0 SVG_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ICON_PATH="$(echo $1 | sed 's/[.]svg/.ico/')"
|
||||
|
||||
convert \
|
||||
-density 300 \
|
||||
-define icon:auto-resize=256,128,96,64,48,32,16 \
|
||||
-background none \
|
||||
"$1" "$ICON_PATH"
|
@ -1,2 +0,0 @@
|
||||
CairoSVG==2.7.0
|
||||
Pillow==10.0.0
|
Loading…
x
Reference in New Issue
Block a user