Restore PROMPT branding, rename waterfall-wiki, and add system tag workflows
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import sharp from "sharp";
|
||||
import {streetPeople} from "./street-people";
|
||||
export async function validateCharacter(path:string) {
|
||||
try {
|
||||
const input=sharp(path,{limitInputPixels:streetPeople.limits.pixels});
|
||||
const meta=await input.metadata();
|
||||
if(meta.format!=="png"||!meta.hasAlpha)throw new Error("Character PNG must have transparency");
|
||||
const stats=await input.stats();const alpha=stats.channels.at(-1)!;
|
||||
if(alpha.min!==0||alpha.max<250)throw new Error("Character PNG must have transparency");
|
||||
}catch{throw new Error("Character PNG must have transparency");}
|
||||
}
|
||||
Reference in New Issue
Block a user