#!/usr/bin/env python3 """Copy and normalize menu images to images/gerichte/.""" import shutil from pathlib import Path ROOT = Path(__file__).parent DEST = ROOT / "images" / "gerichte" DEST.mkdir(parents=True, exist_ok=True) # (source relative to ROOT, dest filename in gerichte/) FILES = [ ("taboulah_transparent_steinplatte.png", "taboulah.png"), ("Fattoush_transparent.png", "fattoush.png"), ("baba_ghanoush_transparent_steinplatte.png", "baba-ghanoush.png"), ("Hummus.png", "hummus.png"), ("kaese_boerek_steinplatte_transparent.png", "kaese-boerek.png"), ("spinat_boerek_steinplatte_transparent.png", "spinat-boerek.png"), ("4x_hackfleisch_boerek_transparent.png", "hackfleisch-boerek.png"), ("kibbe_frittiert_steinplatte_transparent.png", "kibbe-frittiert.png"), ("a_close_up_food_photography_scene_on_a_black_slate.png", "salat-spezial.png"), ("gefuellte_weinblaetter_yalinyi_transparent.png", "weinblaetter.png"), ("abu_ali_salat_spezial_haehnchen_transparent.png", "abu-ali-salat.png"), ("vorspeisen_teller_vegetarisch_transparent.png", "vorspeisen-teller.png"), ("falafel_teller_steinplatte_transparent.png", "falafel-teller.png"), ("a_close_up_food_photography_scene_a_bowl_of_soup.png", "linsensuppe.png"), ("mexicano_steinplatte_transparent.png", "menue-mexicano.png"), ("faijta_steinplatte_transparent.png", "menue-faijta.png"), ("francisco_sandwich_transparent_steinplatte.png", "menue-francisco.png"), ("Philadelphia_Sandwich_transparent.png", "menue-philadelphia.png"), ("haehnchenspiess_steinplatte_transparent.png", "menue-haehnchenspiess.png"), ("crispy_transparent_background.png", "menue-crispy.png"), ("haehnchenleber_steinplatte_transparent.png", "menue-haehnchenleber.png"), ("broasted_halbes_haehnchen_transparent.png", "menue-broasted.png"), ("a_close_up_food_photography_scene_on_a_dark_slate.png", "menue-mendi-lamm.png"), ("kebsi_halbes_haehnchen_mit_reis_transparent.png", "menue-kebsi.png"), ("arabischer_shawarma_teller_transparent.png", "menue-shawarma.png"), ("a_close_up_food_photography_scene_on_a_dark_backgr.png", "menue-nuggets.png"), ("Lahmacun.png", "lahmacun.png"), ("käse pide .png", "kaese-manaesch.png"), ("käse pide .png", "kaesetasche.png"), ("Hähnchen-Pide mit Käse.png", "haehnchen-pide.png"), ("Hackfleisch-Pide .png", "hackfleisch-pide.png"), ("Sucuk-Käse-Pide.png", "sucuk-pide.png"), ("dreieckige_spinattasche_transparent.png", "spinattasche.png"), ("haehnchenleber_pide_transparent.png", "haehnchenleber-pide.png"), ("paprika_manaesch_pide_transparent.png", "paprika-manaesch.png"), ("zaater_manaesch_pide_transparent.png", "zaater-manaesch.png"), ("fleisch pide.png", "toshka.png"), ("4x_Mini-Pide.png", "mini-pide.png"), ("steak_manaesch_pide_transparent.png", "steak-manaesch.png"), ("mexicano_sandwich_transparent.png", "sandwich-mexicano.png"), ("Faijta_Sandwich_transparent.png", "sandwich-faijta.png"), ("francisco_sandwich_transparent_steinplatte.png", "sandwich-francisco.png"), ("Philadelphia_Sandwich_transparent.png", "sandwich-philadelphia.png"), ("haehnchenspiess_sandwich_transparent.png", "sandwich-haehnchenspiess.png"), ("Crispysandwich.png", "sandwich-crispy.png"), ("haehnchenleber_sandwich_transparent.png", "sandwich-haehnchenleber.png"), ("burger_steinplatte_transparent.png", "sandwich-burger.png"), ("a_close_up_studio_food_photograph_a_cheeseburger.png", "sandwich-cheeseburger.png"), ("Shawarma-Sandwich.png", "sandwich-shawarma.png"), ("Kebab-Sandwich.png", "sandwich-kebab.png"), ("Chickencheeseburger_transparent.png", "sandwich-chickencheeseburger.png"), ("pommessandwich_transparent_alpha.png", "sandwich-pommes.png"), ("Falafel-Sandwich_transparent.png", "sandwich-falafel.png"), ("arabisches_sucuk_sandwich_transparent.png", "sandwich-sucuk.png"), ("margherita_pizza_steinplatte_transparent.png", "pizza-margherita.png"), ("salami_pizza_steinplatte_transparent.png", "pizza-salami.png"), ("thunfisch_pizza_steinplatte_transparent.png", "pizza-thunfisch.png"), ("champignon_pizza_steinplatte_transparent.png", "pizza-champignon.png"), ("vegetariana_pizza_transparenter_hintergrund.png", "pizza-vegetariana.png"), ("sucuk_pizza_transparent.png", "pizza-sucuk.png"), ("abu_ali_spezial_pizza_transparent.png", "pizza-abu-ali.png"), ("hackfleischpizza_steinplatte_transparent.png", "pizza-hackfleisch.png"), ("familienpizza_steinplatte_transparent.png", "pizza-familie.png"), ] # Fallback paths for umlaut filenames ALT_SOURCES = { "käse pide .png": ["käse pide .png", "images/pide-kaese.png"], "Hähnchen-Pide mit Käse.png": ["Hähnchen-Pide mit Käse.png", "images/pide-haehnchen-kaese.png"], "Sucuk-Käse-Pide.png": ["Sucuk-Käse-Pide.png", "images/pide-sucuk-kaese.png"], "Hackfleisch-Pide .png": ["Hackfleisch-Pide .png", "images/pide-hackfleisch.png"], } copied = 0 missing = [] for src_name, dest_name in FILES: dest = DEST / dest_name src = ROOT / src_name if not src.exists(): for alt in ALT_SOURCES.get(src_name, []): alt_path = ROOT / alt if not alt.startswith("images/") else ROOT / alt if alt_path.exists(): src = alt_path break if src.exists(): shutil.copy2(src, dest) copied += 1 else: missing.append((src_name, dest_name)) print(f"Copied {copied} images to {DEST}") if missing: print("MISSING:") for s, d in missing: print(f" {s} -> {d}")