summaryrefslogtreecommitdiff
path: root/internal/media/types.go
diff options
context:
space:
mode:
authorLibravatar tsmethurst <tobi.smethurst@protonmail.com>2022-01-09 18:41:22 +0100
committerLibravatar tsmethurst <tobi.smethurst@protonmail.com>2022-01-09 18:41:22 +0100
commitdccf21dd87638320a687a0556c973cced541c945 (patch)
tree03dd737e3d44bdad52b6a2ac2f1e78ec876d2ba1 /internal/media/types.go
parentcompiling now (diff)
downloadgotosocial-dccf21dd87638320a687a0556c973cced541c945.tar.xz
tests are passing, but there's still much to be done
Diffstat (limited to 'internal/media/types.go')
-rw-r--r--internal/media/types.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/internal/media/types.go b/internal/media/types.go
index d40f402d2..aaf423682 100644
--- a/internal/media/types.go
+++ b/internal/media/types.go
@@ -22,6 +22,7 @@ import (
"bytes"
"errors"
"fmt"
+ "time"
"github.com/h2non/filetype"
)
@@ -67,6 +68,31 @@ const (
TypeEmoji Type = "emoji" // TypeEmoji is the key for emoji type requests
)
+// AdditionalInfo represents additional information that should be added to an attachment
+// when processing a piece of media.
+type AdditionalInfo struct {
+ // Time that this media was created; defaults to time.Now().
+ CreatedAt *time.Time
+ // ID of the status to which this media is attached; defaults to "".
+ StatusID *string
+ // URL of the media on a remote instance; defaults to "".
+ RemoteURL *string
+ // Image description of this media; defaults to "".
+ Description *string
+ // Blurhash of this media; defaults to "".
+ Blurhash *string
+ // ID of the scheduled status to which this media is attached; defaults to "".
+ ScheduledStatusID *string
+ // Mark this media as in-use as an avatar; defaults to false.
+ Avatar *bool
+ // Mark this media as in-use as a header; defaults to false.
+ Header *bool
+ // X focus coordinate for this media; defaults to 0.
+ FocusX *float32
+ // Y focus coordinate for this media; defaults to 0.
+ FocusY *float32
+}
+
// parseContentType parses the MIME content type from a file, returning it as a string in the form (eg., "image/jpeg").
// Returns an error if the content type is not something we can process.
func parseContentType(content []byte) (string, error) {