diff --git a/.gitignore b/.gitignore index 137bd49..7bb4750 100644 --- a/.gitignore +++ b/.gitignore @@ -4,12 +4,14 @@ output/*.html # Downloaded QR codes output/qr-codes +# Served icons +output/icons + # Server-side cache cache # Local tests .test -. # Kate *.kate-swp diff --git a/php/utils/room-icons.php b/php/utils/room-icons.php index 3d806cc..73a9e9d 100644 --- a/php/utils/room-icons.php +++ b/php/utils/room-icons.php @@ -16,8 +16,8 @@ * @param string $size Image dimensions. */ function room_icon_path_resized(string $room_id, string $size): string { - global $ROOM_ICONS_CACHE; - return "$ROOM_ICONS_CACHE/$room_id-$size"; + global $ROOM_ICONS; + return "$ROOM_ICONS/$room_id-$size"; } /** @@ -75,7 +75,9 @@ // Resize image $gd_image = imagecreatefromstring($icon_cached_contents); $gd_resized = imagescale($gd_image, $width, $height); - imagewebp($gd_resized, $icon_resized); + if (!imagewebp($gd_resized, $icon_resized)) { + log_info("Converting image for $room_id to $size failed"); + } return room_icon_path_relative($room_id, $size); }