Various improvements and checks

This commit is contained in:
MathMan05 2024-08-20 14:17:54 -05:00
parent a2abc91a2a
commit 1608d00beb
30 changed files with 541 additions and 360 deletions

View file

@ -23,7 +23,7 @@ class File {
}
getHTML(temp = false) {
const src = this.proxy_url || this.url;
if (this.width) {
if (this.width && this.height) {
let scale = 1;
const max = 96 * 3;
scale = Math.max(scale, this.width / max);
@ -57,7 +57,7 @@ class File {
video.append(source);
source.type = this.content_type;
video.controls = !temp;
if (this.width) {
if (this.width && this.height) {
video.width = this.width;
video.height = this.height;
}
@ -97,7 +97,7 @@ class File {
return new File({
filename: file.name,
size: file.size,
id: null,
id: "null",
content_type: file.type,
width: undefined,
height: undefined,