From d8eddb8fab2ec881ecc5b1736431e23f9a6e651b Mon Sep 17 00:00:00 2001 From: Erzangel Date: Wed, 17 Jul 2024 14:59:55 +0000 Subject: [PATCH] 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 --- src/generate_cards_mvp.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/generate_cards_mvp.py b/src/generate_cards_mvp.py index 380ed30..ace0d55 100644 --- a/src/generate_cards_mvp.py +++ b/src/generate_cards_mvp.py @@ -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)