- Google kept showing the KantSites K for Elektro Bernhard after the site icon was changed. The own icon only existed at 32 and 180 px, and Google takes multiples of 48 only; /favicon.svg was a file in public/, so the web server always delivered the bundled K. - The icon is now also cut at 48 and 192 px. The head links /favicon-192.png, /favicon.ico serves the 48 px PNG, and /favicon.svg is answered by the application: the bundled mark without an own icon (now in public/assets/favicon.svg), otherwise a 302 to the 192 px PNG. Sites that set their icon earlier get the new sizes on first request. A removed icon no longer counts even though its files remain. - The archive update only adds files to public/, so it now deletes the old public/favicon.svg explicitly. - Seventh local reference site: the KANTARCI Immobilien landing page with a three-step rental request, own database, seed and reset scripts. Tests: 582 PHPUnit on PHP 8.2 and 8.4, 35 node, test:editor and test:browser green (test:browser reports only the known editor colour contrast on /grundlagen). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
41 lines
1.5 KiB
PHP
41 lines
1.5 KiB
PHP
<?php
|
||
|
||
/**
|
||
* Schneidet aus dem gelieferten Banner (kantarci-banner.jpeg, 901 × 458) die Bilder der
|
||
* KANTARCI-Landingpage zu: das Logo, das Hausmotiv und ein quadratisches Seitensymbol.
|
||
* Die Mediathek nimmt kein SVG, deshalb entsteht das Symbol als PNG.
|
||
*
|
||
* Aufruf: php scripts/build-kantarci-assets.php <banner.jpeg> <zielordner>
|
||
*/
|
||
|
||
[$_, $banner, $ziel] = $argv + [null, null, null];
|
||
if (!is_file((string) $banner) || null === $ziel) {
|
||
fwrite(STDERR, "Aufruf: php scripts/build-kantarci-assets.php <banner.jpeg> <zielordner>\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";
|