Fix watermark replication across animation frames

This commit is contained in:
DarthSim
2024-04-24 21:55:16 +03:00
parent 97217949a7
commit b43c6a7db7
4 changed files with 16 additions and 15 deletions

View File

@@ -72,7 +72,7 @@ func prepareWatermark(wm *vips.Image, wmData *imagedata.ImageData, opts *options
}
if opts.ShouldReplicate() {
if err := wm.Replicate(imgWidth, imgHeight); err != nil {
if err := wm.Replicate(imgWidth, imgHeight, true); err != nil {
return err
}
}
@@ -112,7 +112,7 @@ func applyWatermark(img *vips.Image, wmData *imagedata.ImageData, opts *options.
// If we replicated the watermark and need to apply it to an animated image,
// it is faster to replicate the watermark to all the image and apply it single-pass
if opts.ShouldReplicate() && framesCount > 1 {
if err := wm.Replicate(width, height); err != nil {
if err := wm.Replicate(width, height, false); err != nil {
return err
}