IO-2039 Add unknown file type thumbnail.
This commit is contained in:
@@ -6,7 +6,7 @@ import gm from "gm";
|
||||
import ft from "file-type";
|
||||
import core from "file-type/core";
|
||||
import GenerateUrl from "./MediaUrlGen";
|
||||
import { FolderPaths } from "./serverInit";
|
||||
import { AssetPaths, FolderPaths } from "./serverInit";
|
||||
import { logger } from "../server";
|
||||
const simpleThumb = require("simple-thumbnail");
|
||||
const ffmpeg = require("ffmpeg-static");
|
||||
@@ -53,7 +53,7 @@ export default async function GenerateThumbnail(
|
||||
height: 250,
|
||||
width: 250,
|
||||
});
|
||||
|
||||
console.log("Image success.");
|
||||
await fs.writeFile(thumbPath, thumbnail);
|
||||
}
|
||||
return path.relative(path.dirname(file), thumbPath);
|
||||
@@ -63,7 +63,7 @@ export default async function GenerateThumbnail(
|
||||
err,
|
||||
message: (err as Error).message,
|
||||
});
|
||||
return path.relative(path.dirname(file), thumbPath);
|
||||
return path.relative(path.dirname(file), AssetPaths.File);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user