*/ [$_, $banner, $ziel] = $argv + [null, null, null]; if (!is_file((string) $banner) || null === $ziel) { fwrite(STDERR, "Aufruf: php scripts/build-kantarci-assets.php \n"); exit(1); } if (!is_dir($ziel)) { mkdir($ziel, 0777, true); } $quelle = imagecreatefromjpeg($banner); $zuschnitt = static function (int $x, int $y, int $b, int $h, int $faktor = 1) use ($quelle) { $bild = imagecreatetruecolor($b * $faktor, $h * $faktor); imagecopyresampled($bild, $quelle, 0, 0, $x, $y, $b * $faktor, $h * $faktor, $b, $h); return $bild; }; // Logo: Bildmarke und Schriftzug oben links, auf Weiß. imagepng($zuschnitt(22, 8, 396, 104), $ziel.'/logo-kantarci.png', 9); // Hausmotiv: der Fotoanteil rechts, oberhalb des goldenen Bands. imagejpeg($zuschnitt(500, 0, 401, 334), $ziel.'/haus.jpg', 90); // Seitensymbol: die Bildmarke mittig auf Weiß, 256 × 256. $symbol = imagecreatetruecolor(256, 256); imagefill($symbol, 0, 0, imagecolorallocate($symbol, 255, 255, 255)); imagecopyresampled($symbol, $quelle, 28, 28, 26, 12, 200, 200, 80, 80); imagepng($symbol, $ziel.'/symbol-kantarci.png', 9); echo "Bilder geschrieben nach $ziel\n";