From 818aabf13d74056e8208a4fc72d6daf72287820b Mon Sep 17 00:00:00 2001 From: Adrian Shum Date: Wed, 12 Oct 2022 11:34:49 +0800 Subject: [PATCH] refactor: meta format cleanup --- processor.go | 2 +- testdata/golden/result/meta/everybody-betray-me.mkv | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/processor.go b/processor.go index bf77d93..ecfd1d9 100644 --- a/processor.go +++ b/processor.go @@ -115,7 +115,7 @@ func (p *Processor) Process(ctx context.Context, in *imagor.Blob, params imagorp meta := av.Metadata() if params.Meta { out = imagor.NewBlobFromJsonMarshal(Metadata{ - Format: mime.Extension(), + Format: strings.TrimPrefix(mime.Extension(), "."), ContentType: mime.String(), Metadata: meta, }) diff --git a/testdata/golden/result/meta/everybody-betray-me.mkv b/testdata/golden/result/meta/everybody-betray-me.mkv index 434da4a..53a0f24 100644 --- a/testdata/golden/result/meta/everybody-betray-me.mkv +++ b/testdata/golden/result/meta/everybody-betray-me.mkv @@ -1 +1 @@ -{"format":".mkv","content_type":"video/x-matroska","orientation":1,"duration":7407000000,"width":640,"height":480,"has_video":true,"has_audio":true,"has_alpha":false} \ No newline at end of file +{"format":"mkv","content_type":"video/x-matroska","orientation":1,"duration":7407000000,"width":640,"height":480,"has_video":true,"has_audio":true,"has_alpha":false} \ No newline at end of file