Files
lucent-laravel/front/js/svelte/files/imageserver.js
T

32 lines
877 B
JavaScript
Raw Normal View History

2023-10-02 23:10:49 +03:00
import {getContext} from "svelte";
export function imgurl(record, width = "", height = "", mode = "") {
// let argumentString = "-o";
// if (mode) {
// argumentString += "-mode_fit";
// }
// if (width) {
// argumentString += "-w_" + width;
// }
// if (height) {
// argumentString += "-h_" + height;
// }
// let pathAr = record._file.path.split(".");
// let ext = pathAr.pop();
// let filename = record._file.path.replace("." + ext, "");
// let cache = "cache/"
// if (!mode && !width && !height) {
// argumentString = "";
// cache = "";
// }
const channel = getContext("channel")
return channel.filesUrl + `/thumbs/${record._file.path}`;
}
export function fileurl(record) {
const channel = getContext("channel")
return channel.filesUrl + `/${record._file.path}`;
}