diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dbc24f5..b7a127c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ bugs in actually-released versions. This just means that the Manager has to tell the Worker which Blender to use, which is perfectly fine. - Fix error in sleep scheduler when shutting down the Manager. +- Workers can now decode TIFF files to generate previews. ## 3.0 - released 2022-09-12 diff --git a/internal/worker/command_ffmpeg_test_files/frame-1.tiff b/internal/worker/command_ffmpeg_test_files/frame-1.tiff new file mode 100644 index 00000000..6e9c8f43 Binary files /dev/null and b/internal/worker/command_ffmpeg_test_files/frame-1.tiff differ diff --git a/internal/worker/output_uploader.go b/internal/worker/output_uploader.go index 7ae37e3c..c4c9d2ef 100644 --- a/internal/worker/output_uploader.go +++ b/internal/worker/output_uploader.go @@ -14,6 +14,7 @@ import ( "sync" "github.com/rs/zerolog/log" + _ "golang.org/x/image/tiff" "git.blender.org/flamenco/pkg/last_in_one_out_queue" ) diff --git a/internal/worker/output_uploader_test.go b/internal/worker/output_uploader_test.go index dacb61e0..191127c0 100644 --- a/internal/worker/output_uploader_test.go +++ b/internal/worker/output_uploader_test.go @@ -93,6 +93,34 @@ func TestProcess(t *testing.T) { } +func TestProcessTiff(t *testing.T) { + ou, mocks, finish := mockedOutputUploader(t) + defer finish() + + taskID := "094d98ba-d6e2-4765-a10b-70533604a952" + filename := "command_ffmpeg_test_files/frame-1.tiff" + + item := TaskOutput{ + TaskID: taskID, + Filename: filename, + } + + { + // Test happy response from Manager. + response := api.TaskOutputProducedResponse{ + HTTPResponse: &http.Response{ + Status: "202 Accepted", + StatusCode: http.StatusAccepted, + }, + } + mocks.client.EXPECT().TaskOutputProducedWithBodyWithResponse( + mocks.ctx, taskID, "image/jpeg", gomock.Any()). + Return(&response, nil) + + ou.process(mocks.ctx, item) + } +} + type outputUploaderTestMocks struct { client *mocks.MockFlamencoClient ctx context.Context