|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|