Fall back to plain profile picture if imagemagick is not installed
This commit is contained in:
parent
30a74acf3b
commit
c1c9a37914
@ -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 {
|
||||
if (magick) {
|
||||
return `${config.base_url}/assets/g/img/og-p-${this.event.id}.png`;
|
||||
} else {
|
||||
return this.picture || "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user