-., Default-Endung jpg. ext: 'png' für freigestellte Motive, * deren Transparenz JPG zerstören würde (Spielerfoto auf dem Cover). * ODER array{src: string, width: int, height: int, alt: string} — Originaldatei 1:1 * $sizes string (optional, default '100vw') * $eager bool (optional) — above the fold: eager + fetchpriority high * $class string (optional) */ $sizes = $sizes ?? '100vw'; $eager = $eager ?? false; $class = $class ?? ''; if (!empty($image['src'])): ?> src="" alt="" width="" height="" > asset("{$image['base']}-{$w}.{$ext}") . " {$w}w", $widths )); // Maße der größten Variante für width/height (CLS-Vermeidung). [$w, $h] = (function () use ($image, $largest, $ext): array { static $dims = []; $file = PUBLIC_PATH . "/assets/{$image['base']}-{$largest}.{$ext}"; $key = $file; if (!isset($dims[$key])) { $size = is_file($file) ? (getimagesize($file) ?: [0, 0]) : [0, 0]; $dims[$key] = [$size[0], $size[1]]; } return $dims[$key]; })(); ?> src="" srcset="" sizes="" alt="" width="" height="" >