mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] use webp for thumbnails (#3116)
* update to use webp for thumbnails * bump webp quality up to 40% from 12% (it's a bit different to jpeg quality setting) * update to use yuva colorspace, and use thumbnail=n=10 to select frame * fix missing comma in ffmpeg args * add links to appropriate ffmpeg docs * update tests * add file size tests for thumbnails --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
This commit is contained in:
@@ -122,11 +122,11 @@ func (suite *ServeFileTestSuite) TestServeSmallLocalFileOK() {
|
||||
targetAttachment.AccountID,
|
||||
media.TypeAttachment,
|
||||
media.SizeSmall,
|
||||
targetAttachment.ID+".jpg",
|
||||
targetAttachment.ID+".webp",
|
||||
)
|
||||
|
||||
suite.Equal(http.StatusOK, code)
|
||||
suite.Equal("image/jpeg", headers.Get("content-type"))
|
||||
suite.Equal("image/webp", headers.Get("content-type"))
|
||||
suite.Equal(fileInStorage, body)
|
||||
}
|
||||
|
||||
@@ -162,11 +162,11 @@ func (suite *ServeFileTestSuite) TestServeSmallRemoteFileOK() {
|
||||
targetAttachment.AccountID,
|
||||
media.TypeAttachment,
|
||||
media.SizeSmall,
|
||||
targetAttachment.ID+".jpg",
|
||||
targetAttachment.ID+".webp",
|
||||
)
|
||||
|
||||
suite.Equal(http.StatusOK, code)
|
||||
suite.Equal("image/jpeg", headers.Get("content-type"))
|
||||
suite.Equal("image/webp", headers.Get("content-type"))
|
||||
suite.Equal(fileInStorage, body)
|
||||
}
|
||||
|
||||
@@ -208,11 +208,11 @@ func (suite *ServeFileTestSuite) TestServeSmallRemoteFileRecache() {
|
||||
targetAttachment.AccountID,
|
||||
media.TypeAttachment,
|
||||
media.SizeSmall,
|
||||
targetAttachment.ID+".jpg",
|
||||
targetAttachment.ID+".webp",
|
||||
)
|
||||
|
||||
suite.Equal(http.StatusOK, code)
|
||||
suite.Equal("image/jpeg", headers.Get("content-type"))
|
||||
suite.Equal("image/webp", headers.Get("content-type"))
|
||||
suite.Equal(fileInStorage, body)
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ func (suite *ServeFileTestSuite) TestServeSmallRemoteFileRecacheNotFound() {
|
||||
targetAttachment.AccountID,
|
||||
media.TypeAttachment,
|
||||
media.SizeSmall,
|
||||
targetAttachment.ID+".jpg",
|
||||
targetAttachment.ID+".webp",
|
||||
)
|
||||
|
||||
suite.Equal(http.StatusNotFound, code)
|
||||
|
Reference in New Issue
Block a user