add cachekey

This commit is contained in:
eugene 2025-09-14 22:39:50 +03:00
parent 83663aa9db
commit e668777431
2 changed files with 2 additions and 1 deletions

1
tgs.go
View File

@ -13,6 +13,7 @@ type TGSTransformOptions struct {
Qualtity int Qualtity int
ResizeWidth int ResizeWidth int
ResizeHeight int ResizeHeight int
CacheKey string
} }
type TGSConverter interface { type TGSConverter interface {

View File

@ -38,7 +38,7 @@ func (t tgsConverterImpl) Transform(ctx context.Context, in io.Reader, out io.Wr
return err return err
} }
anim := rlottie.LottieAnimationFromData(buf.String(), "", "") anim := rlottie.LottieAnimationFromData(buf.String(), opts.CacheKey, "")
defer rlottie.LottieAnimationDestroy(anim) defer rlottie.LottieAnimationDestroy(anim)
width, height := rlottie.LottieAnimationGetSize(anim) width, height := rlottie.LottieAnimationGetSize(anim)