Add image metadata to image uploads

Adds blurhash and image dimensions. This is an alternative and backwards
compatible version of NIP94 for images in kind1 notes.

Changelog-Added: Add image metadata to image uploads
This commit is contained in:
William Casarin
2023-04-26 10:41:05 -07:00
parent 46b53e1326
commit 3b50f82094
9 changed files with 546 additions and 10 deletions
+7 -7
View File
@@ -11,17 +11,17 @@ struct NostrPost {
let kind: NostrKind
let content: String
let references: [ReferencedId]
let tags: [[String]]
init (content: String, references: [ReferencedId]) {
self.content = content
self.references = references
self.kind = .text
}
init (content: String, references: [ReferencedId], kind: NostrKind) {
init (content: String, references: [ReferencedId], kind: NostrKind = .text, tags: [[String]] = []) {
self.content = content
self.references = references
self.kind = kind
self.tags = tags
}
func to_event(keypair: FullKeypair) -> NostrEvent {
return post_to_event(post: self, privkey: keypair.privkey, pubkey: keypair.pubkey)
}
}