diff options
author | 2022-03-21 19:46:51 +0100 | |
---|---|---|
committer | 2022-03-21 19:46:51 +0100 | |
commit | 25cab0e1f4fdd89512088d0d02c4abd7b4d11773 (patch) | |
tree | d7c306610025eab45d2e3e204f492334c74ae370 /internal/media | |
parent | don't error if content property is nil (#436) (diff) | |
download | gotosocial-25cab0e1f4fdd89512088d0d02c4abd7b4d11773.tar.xz |
[bugfix] Fix images not being processed correctly sometimes (#437)
* bump exif-terminator to latest version
* add and test giant turnip from turnip.farm
* don't error if content property is nil
Diffstat (limited to 'internal/media')
-rw-r--r-- | internal/media/image.go | 6 | ||||
-rw-r--r-- | internal/media/processingmedia.go | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/internal/media/image.go b/internal/media/image.go index e5390cee5..4f2db0e95 100644 --- a/internal/media/image.go +++ b/internal/media/image.go @@ -125,7 +125,7 @@ func deriveThumbnail(r io.Reader, contentType string, createBlurhash bool) (*ima } if err != nil { - return nil, err + return nil, fmt.Errorf("error decoding image as %s: %s", contentType, err) } if i == nil { @@ -151,7 +151,7 @@ func deriveThumbnail(r io.Reader, contentType string, createBlurhash bool) (*ima tiny := resize.Thumbnail(32, 32, thumb, resize.NearestNeighbor) bh, err := blurhash.Encode(4, 3, tiny) if err != nil { - return nil, err + return nil, fmt.Errorf("error creating blurhash: %s", err) } im.blurhash = bh } @@ -161,7 +161,7 @@ func deriveThumbnail(r io.Reader, contentType string, createBlurhash bool) (*ima // Quality isn't extremely important for thumbnails, so 75 is "good enough" Quality: 75, }); err != nil { - return nil, err + return nil, fmt.Errorf("error encoding thumbnail: %s", err) } im.small = out.Bytes() diff --git a/internal/media/processingmedia.go b/internal/media/processingmedia.go index 3cf4805f7..63e03a409 100644 --- a/internal/media/processingmedia.go +++ b/internal/media/processingmedia.go @@ -260,6 +260,7 @@ func (p *ProcessingMedia) store(ctx context.Context) error { if err != nil { return fmt.Errorf("store: error executing data function: %s", err) } + logrus.Tracef("store: reading %d bytes from data function for media %s", fileSize, p.attachment.URL) // defer closing the reader when we're done with it defer func() { @@ -342,6 +343,7 @@ func (p *ProcessingMedia) store(ctx context.Context) error { return p.postData(ctx) } + logrus.Tracef("store: finished storing initial data for attachment %s", p.attachment.URL) return nil } |