Feature: AVIF support (#6288)

This commit is contained in:
Gykes
2025-11-27 14:19:32 -06:00
committed by GitHub
parent 4ef3a605dd
commit 90d1b2df2d
6 changed files with 43 additions and 11 deletions

View File

@@ -4,6 +4,8 @@ import (
"context"
"fmt"
"image"
"path/filepath"
"strings"
_ "image/gif"
_ "image/jpeg"
@@ -28,6 +30,11 @@ func (d *Decorator) Decorate(ctx context.Context, fs models.FS, f models.File) (
// ignore clips in non-OsFS filesystems as ffprobe cannot read them
// TODO - copy to temp file if not an OsFS
if _, isOs := fs.(*file.OsFS); !isOs {
// AVIF images inside zip files are not supported
if strings.ToLower(filepath.Ext(base.Path)) == ".avif" {
logger.Warnf("Skipping AVIF image in zip file: %s", base.Path)
return f, nil
}
logger.Debugf("assuming ImageFile for non-OsFS file %q", base.Path)
return decorateFallback(fs, f)
}