mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-03 03:08:06 -06:00
[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
This commit is contained in:
parent
36b2f2b4e6
commit
25cab0e1f4
22 changed files with 245 additions and 46 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue