mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-04 12:12:26 -06:00
fiddly widdly imagey wimagey
This commit is contained in:
parent
d29ebc3d27
commit
3868803ff1
3 changed files with 6 additions and 2 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 293 KiB After Width: | Height: | Size: 753 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 29 KiB |
|
|
@ -206,7 +206,9 @@ func deriveImage(b []byte, contentType string) (*imageAndMeta, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
out := &bytes.Buffer{}
|
out := &bytes.Buffer{}
|
||||||
if err := jpeg.Encode(out, i, nil); err != nil {
|
if err := jpeg.Encode(out, i, &jpeg.Options{
|
||||||
|
Quality: 100,
|
||||||
|
}); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -256,7 +258,9 @@ func deriveThumbnail(b []byte, contentType string, x uint, y uint) (*imageAndMet
|
||||||
aspect := float64(width) / float64(height)
|
aspect := float64(width) / float64(height)
|
||||||
|
|
||||||
out := &bytes.Buffer{}
|
out := &bytes.Buffer{}
|
||||||
if err := jpeg.Encode(out, thumb, nil); err != nil {
|
if err := jpeg.Encode(out, thumb, &jpeg.Options{
|
||||||
|
Quality: 100,
|
||||||
|
}); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &imageAndMeta{
|
return &imageAndMeta{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue