From 8f8521d697e7d59732492486927551fa6c63dd99 Mon Sep 17 00:00:00 2001 From: miyuko Date: Wed, 22 Oct 2025 17:24:29 +0100 Subject: [PATCH] Don't compress video or audio files. --- src/manifest.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/manifest.go b/src/manifest.go index 4418393..c60d2e1 100644 --- a/src/manifest.go +++ b/src/manifest.go @@ -170,6 +170,10 @@ func CompressFiles(ctx context.Context, manifest *Manifest) { var originalSize, transformedSize int64 for _, entry := range manifest.Contents { if entry.GetType() == Type_InlineFile && entry.GetTransform() == Transform_None { + mtype := getMediaType(entry.GetContentType()) + if strings.HasPrefix(mtype, "video/") || strings.HasPrefix(mtype, "audio/") { + continue + } originalSize += entry.GetSize() compressedData := zstdEncoder.EncodeAll(entry.GetData(), make([]byte, 0, entry.GetSize())) if len(compressedData) < int(*entry.Size) {