From 12e845a36de15d0c636416f276d8ef785548ee78 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Thu, 8 Feb 2018 21:54:07 -0700 Subject: [PATCH] Add support for jpeg backgrounds --- lib/gencontent.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/gencontent.php b/lib/gencontent.php index 84bf2ee..9119fcd 100644 --- a/lib/gencontent.php +++ b/lib/gencontent.php @@ -95,6 +95,8 @@ echo $pubcss; if (file_exists(__DIR__ . "/../themes/" . $pubdata['style'] . "/background.png")) { echo "\n\tbackground-image: url('data:image/png;base64," . base64_encode(file_get_contents(__DIR__ . "/../themes/" . $pubdata['style'] . "/background.png")) . "');"; +} else if (file_exists(__DIR__ . "/../themes/" . $pubdata['style'] . "/background.jpg")) { + echo "\n\tbackground-image: url('data:image/jpeg;base64," . base64_encode(file_get_contents(__DIR__ . "/../themes/" . $pubdata['style'] . "/background.jpg")) . "');"; } $pagesize = $database->get("page_sizes", ["sizewidth (width)", "sizeheight (height)"], ["sizeid" => $pubdata["page_size"]]);