mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-07-08 01:31:00 +08:00
Update /api/thumbnail
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/// <reference lib="deno.unstable" />
|
||||
import { Struct } from "pwn/mod.ts";
|
||||
import { ThumbnailAlign, ThumbnailGenMethod } from "./base.ts";
|
||||
import { ThumbnailAlign, ThumbnailConfig, ThumbnailGenMethod } from "./base.ts";
|
||||
|
||||
let libSuffix = "";
|
||||
let libPrefix = "lib";
|
||||
@@ -78,3 +78,25 @@ export async function gen_thumbnail(
|
||||
if (re.e) return get_error(ore);
|
||||
return;
|
||||
}
|
||||
|
||||
export async function fa_generate_thumbnail(
|
||||
i: string,
|
||||
o: string,
|
||||
cfg: ThumbnailConfig,
|
||||
) {
|
||||
let method = cfg.method;
|
||||
if (method === ThumbnailGenMethod.Unknown) method = ThumbnailGenMethod.Fill;
|
||||
const re = await gen_thumbnail(
|
||||
i,
|
||||
o,
|
||||
cfg.width,
|
||||
cfg.height,
|
||||
method,
|
||||
cfg.align,
|
||||
cfg.quality,
|
||||
);
|
||||
if (re) {
|
||||
console.error(re);
|
||||
}
|
||||
return re === undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user