fix: use missing image if image does not really exist

i commited this on my work computer without an ide so lets pray this works
This commit is contained in:
2024-07-17 14:59:55 +00:00
parent fa25ccfb0d
commit d8eddb8fab
+4
View File
@@ -82,6 +82,10 @@ for card_data in cards:
image_path="../../img/missing.png",
flavor_text_type=None,
)
# Check if card image really exists
if not Path(card_skin_data.image_path).exists():
print("Missing image for card id: ", card_data["id"], " , using default image")
card_skin_data = "../../img/missing.png"
# Create a new SVG drawing
output_dir = "output/" + all_skin_data["skin_name"]
os.makedirs(output_dir, exist_ok=True)