feat(images): JPEG XL optimizer with webp/jpg fallback and <picture> serving

img_optimize() decodes .jxl with djxl or Imagick, resizes with GD, re-encodes
with cjxl and writes foto.jxl.webp beside it; skips cleanly without a decoder.
Gallery, hero, navbar logos and JSON-LD serve the JXL with the fallback, and
trash/removal move the fallback with its .jxl.
This commit is contained in:
andre committed 2026-10-26 11:18:13 +00:00
1 parent 8fe73eb5d6
commit 4f44bc1609
14 files changed
+260 -20

No files matched your search

+3
View File
@@ -269,9 +269,12 @@ function _trash_image_file(PDO $pdo, int $imageId, string $action): void {
if ($action === 'delete' && is_file($live)) {
if (!is_dir($dir . '.trash')) @mkdir($dir . '.trash', 0775, true);
@rename($live, $trash);
img_fallback_follow($live, $trash); // foto.jxl.webp goes with foto.jxl
} elseif ($action === 'restore' && is_file($trash)) {
@rename($trash, $live);
img_fallback_follow($trash, $live);
} elseif ($action === 'purge') {
if (is_file($trash)) @unlink($trash);
img_fallback_follow($trash);
}
}