[bugfix] take into account rotation when generating thumbnail (#3147)

* take into account rotation when generating thumbnail, simplify ffprobe output to show only fields we need

* only show rotation side data

* remove unnecessary comment

* fix code comments

* remove debug logging
This commit is contained in:
kim 2024-07-28 19:10:41 +00:00 committed by GitHub
commit 368c97f0f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 102 additions and 20 deletions

View file

@ -483,7 +483,7 @@ func (suite *ManagerTestSuite) TestLongerMp4Process() {
suite.EqualValues(float32(10), *attachment.FileMeta.Original.Framerate)
suite.EqualValues(0xce3a, *attachment.FileMeta.Original.Bitrate)
suite.EqualValues(gtsmodel.Small{
Width: 512, Height: 281, Size: 143872, Aspect: 1.822064,
Width: 512, Height: 281, Size: 143872, Aspect: 1.8181819,
}, attachment.FileMeta.Small)
suite.Equal("video/mp4", attachment.File.ContentType)
suite.Equal("image/webp", attachment.Thumbnail.ContentType)
@ -543,7 +543,7 @@ func (suite *ManagerTestSuite) TestBirdnestMp4Process() {
suite.EqualValues(float32(30), *attachment.FileMeta.Original.Framerate)
suite.EqualValues(0x11844c, *attachment.FileMeta.Original.Bitrate)
suite.EqualValues(gtsmodel.Small{
Width: 287, Height: 512, Size: 146944, Aspect: 0.5605469,
Width: 287, Height: 512, Size: 146944, Aspect: 0.5611111,
}, attachment.FileMeta.Small)
suite.Equal("video/mp4", attachment.File.ContentType)
suite.Equal("image/webp", attachment.Thumbnail.ContentType)