feat: support specifying image format
This commit is contained in:
+13
-1
@@ -218,6 +218,7 @@ export function card(app: App) {
|
||||
lang,
|
||||
substat: enableSubstat,
|
||||
quality: enableRollQuality,
|
||||
format,
|
||||
},
|
||||
}) => {
|
||||
log`Rendering ${uid}/${charId}`;
|
||||
@@ -290,6 +291,7 @@ export function card(app: App) {
|
||||
enableSubstat,
|
||||
enableRollQuality,
|
||||
debug,
|
||||
format,
|
||||
}),
|
||||
).toString(36);
|
||||
if (feature("API")) {
|
||||
@@ -870,7 +872,7 @@ export function card(app: App) {
|
||||
{ data: await shade.arrayBuffer(), src: "shade" },
|
||||
],
|
||||
fetchedResources: resources.filter((e) => e.data.byteLength),
|
||||
format: "webp",
|
||||
format,
|
||||
drawDebugBorder: debug === "render",
|
||||
stylesheets: [
|
||||
/* css */ `
|
||||
@@ -965,6 +967,16 @@ export function card(app: App) {
|
||||
description: "Add roll quality under artifact substats.",
|
||||
default: false,
|
||||
}),
|
||||
format: t.Enum(
|
||||
{
|
||||
jpeg: "jpeg",
|
||||
webp: "webp",
|
||||
png: "png",
|
||||
},
|
||||
{
|
||||
default: "webp",
|
||||
},
|
||||
),
|
||||
},
|
||||
{ additionalProperties: true },
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user