From f77005128a391025c16fb65c47a4272ac003cbf1 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Thu, 8 Aug 2024 17:12:13 +0000 Subject: [performance] move thumbnail generation to go code where possible (#3183) * wrap thumbnailing code to handle generation natively where possible * more code comments! * add even more code comments! * add code comments about blurhash generation * maintain image rotation if contained in exif data * move rotation before resizing * ensure pix_fmt actually selected by ffprobe, check for alpha layer with gifs * use linear instead of nearest-neighbour for resizing * work with image "orientation" instead of "rotation". use default 75% quality for both webp and jpeg generation * add header to new file * use thumb extension when getting thumb mime type * update test models and tests with new media processing * add suggested code comments * add note about thumbnail filter count reducing memory usage --- internal/processing/media/getfile_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/processing') diff --git a/internal/processing/media/getfile_test.go b/internal/processing/media/getfile_test.go index d80962172..34f5d99a2 100644 --- a/internal/processing/media/getfile_test.go +++ b/internal/processing/media/getfile_test.go @@ -197,7 +197,7 @@ func (suite *GetFileTestSuite) TestGetRemoteFileThumbnailUncached() { suite.NoError(content.Content.Close()) suite.Equal(thumbnailBytes, b) - suite.Equal("image/webp", content.ContentType) + suite.Equal("image/jpeg", content.ContentType) suite.EqualValues(testAttachment.Thumbnail.FileSize, content.ContentLength) } -- cgit v1.2.3