summaryrefslogtreecommitdiff
path: root/internal/processing/media/create.go
diff options
context:
space:
mode:
authorLibravatar tsmethurst <tobi.smethurst@protonmail.com>2022-01-23 14:41:58 +0100
committerLibravatar tsmethurst <tobi.smethurst@protonmail.com>2022-01-23 14:41:58 +0100
commitc157b1b20b38cc331cfd1673433d077719feef3f (patch)
tree69777c5d300ed87d0ac8bb0daf51d8ffa4c4ddb7 /internal/processing/media/create.go
parentuse exif-terminator (diff)
downloadgotosocial-c157b1b20b38cc331cfd1673433d077719feef3f.tar.xz
rework data function to provide filesize
Diffstat (limited to 'internal/processing/media/create.go')
-rw-r--r--internal/processing/media/create.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/processing/media/create.go b/internal/processing/media/create.go
index 0fda4c27b..4047278eb 100644
--- a/internal/processing/media/create.go
+++ b/internal/processing/media/create.go
@@ -29,8 +29,9 @@ import (
)
func (p *processor) Create(ctx context.Context, account *gtsmodel.Account, form *apimodel.AttachmentRequest) (*apimodel.Attachment, error) {
- data := func(innerCtx context.Context) (io.Reader, error) {
- return form.File.Open()
+ data := func(innerCtx context.Context) (io.Reader, int, error) {
+ f, err := form.File.Open()
+ return f, int(form.File.Size), err
}
focusX, focusY, err := parseFocus(form.Focus)