image fixes
This commit is contained in:
@@ -2,7 +2,8 @@ export function imgurl(channel, file) {
|
||||
if (file.mime === "image/svg+xml") {
|
||||
return fileurl(channel, file);
|
||||
}
|
||||
return channel.filesUrl + `/thumbs/${file.path}`;
|
||||
const webpPath = file.path.slice(0, file.path.lastIndexOf(".")) + ".webp";
|
||||
return channel.filesUrl + `/thumbs/${webpPath}`;
|
||||
}
|
||||
|
||||
export function fileurl(channel, file) {
|
||||
@@ -16,7 +17,8 @@ export function htmlurl(channel, file, preset) {
|
||||
if (file.width > 0) {
|
||||
let presetUrl = url;
|
||||
if (preset) {
|
||||
presetUrl = channel.filesUrl + `/templates/${preset}/${file.path}`;
|
||||
const webpPath = file.path.slice(0, file.path.lastIndexOf(".")) + ".webp";
|
||||
presetUrl = channel.filesUrl + `/templates/${preset}/${webpPath}`;
|
||||
}
|
||||
html = `<img src="${presetUrl}" alt="${file.path}" />`;
|
||||
} else if (file.mime === "image/svg+xml") {
|
||||
|
||||
Reference in New Issue
Block a user