- Website of Garten- und Landschaftsbau Hüfner GmbH rebuilt from the delivered design with imprint, privacy, 404 and the enquiry form (scripts/reset-huefner.sh, ports 8102/8103), Barlow and Barlow Condensed served locally with their licence. - Buttons, icon cards, calls to action, icons and linked images accept tel: and mailto: links, the same targets menus and rich text already allowed (ADR 107). - The arrow inside a button takes the button's text colour instead of the accent colour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
46 lines
1.8 KiB
PHP
46 lines
1.8 KiB
PHP
<?php
|
||
|
||
/**
|
||
* Bereitet die Bilder des Hüfner-Entwurfs für die Mediathek vor.
|
||
*
|
||
* Kopiert die Fotos und das Logo aus dem gelieferten Ordner (images/) und schneidet aus dem Logo
|
||
* den Baum mit den Steinen als quadratisches Seitensymbol (favicon.png) heraus. Der Baum ist im
|
||
* Logo links, der Schriftzug rechts; ein Favicon mit Schrift wäre in 32 px unlesbar.
|
||
*
|
||
* Aufruf: php scripts/build-huefner-assets.php <Quellordner mit images/> <Zielordner>
|
||
*/
|
||
$quelle = rtrim($argv[1] ?? '', '/\\');
|
||
$ziel = rtrim($argv[2] ?? '', '/\\');
|
||
if ('' === $quelle || '' === $ziel || !is_dir($quelle.'/images')) {
|
||
fwrite(STDERR, "Aufruf: php scripts/build-huefner-assets.php <Ordner mit images/> <Zielordner>\n");
|
||
exit(1);
|
||
}
|
||
if (!is_dir($ziel) && !mkdir($ziel, 0775, true)) {
|
||
fwrite(STDERR, "Zielordner lässt sich nicht anlegen: $ziel\n");
|
||
exit(1);
|
||
}
|
||
|
||
foreach (glob($quelle.'/images/*.{jpg,png}', GLOB_BRACE) ?: [] as $datei) {
|
||
copy($datei, $ziel.'/'.basename($datei));
|
||
}
|
||
|
||
// Baum und Steine: im 1600 x 607 px großen Logo etwa x 15–500, y 10–560.
|
||
$logo = imagecreatefrompng($quelle.'/images/logo.png');
|
||
if (false === $logo) {
|
||
fwrite(STDERR, "logo.png lässt sich nicht lesen.\n");
|
||
exit(1);
|
||
}
|
||
$kante = 512;
|
||
$symbol = imagecreatetruecolor($kante, $kante);
|
||
imagesavealpha($symbol, true);
|
||
imagealphablending($symbol, false);
|
||
imagefill($symbol, 0, 0, imagecolorallocatealpha($symbol, 0, 0, 0, 127));
|
||
imagealphablending($symbol, true);
|
||
[$x, $y, $b, $h] = [15, 10, 490, 550];
|
||
$massstab = min(($kante - 24) / $b, ($kante - 24) / $h);
|
||
$zb = (int) round($b * $massstab);
|
||
$zh = (int) round($h * $massstab);
|
||
imagecopyresampled($symbol, $logo, (int) (($kante - $zb) / 2), (int) (($kante - $zh) / 2), $x, $y, $zb, $zh, $b, $h);
|
||
imagepng($symbol, $ziel.'/favicon.png');
|
||
echo "Bilder kopiert, Seitensymbol geschnitten: $ziel\n";
|