From 1426aaca8550dbc6d2449c4cf6cf327e75260663 Mon Sep 17 00:00:00 2001 From: RiskoZoSlovenska Date: Mon, 11 Mar 2024 14:50:57 -0400 Subject: [PATCH] Fix watermark example in LuaJIT LuaJIT does not support the `//` operator --- example/watermark.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/watermark.lua b/example/watermark.lua index 466bc1f..0c8da90 100755 --- a/example/watermark.lua +++ b/example/watermark.lua @@ -19,8 +19,8 @@ text = (text * 0.3):cast("uchar") text = text:gravity("centre", 200, 200) -- this block of pixels will be reused many times ... make a copy text = text:copy_memory() -text = text:replicate(1 + im:width() // text:width(), - 1 + im:height() // text:height()) +text = text:replicate(1 + math.floor(im:width() / text:width()), + 1 + math.floor(im:height() / text:height())) text = text:crop(0, 0, im:width(), im:height()) -- we make a constant colour image and attach the text mask as the alpha