diff --git a/models/profile.ts b/models/profile.ts index e50759a..fcb9b8d 100644 --- a/models/profile.ts +++ b/models/profile.ts @@ -1,6 +1,9 @@ import { nip19, NostrEvent as NEvent } from "@nostr/tools"; +import { getImageMagickCommand } from "../utils.ts"; import config from "../config.ts"; +const magick = await getImageMagickCommand(); + export interface ProfileData { name?: string; display_name?: string; @@ -60,6 +63,10 @@ export default class Profile { } get ogImageUrl(): string { - return `${config.base_url}/assets/g/img/og-p-${this.event.id}.png`; + if (magick) { + return `${config.base_url}/assets/g/img/og-p-${this.event.id}.png`; + } else { + return this.picture || ""; + } } }