Use magickprefix

This commit is contained in:
mid 2024-06-11 16:41:16 +03:00
parent 9b3643e82d
commit 59a5f48780

2
db.lua
View File

@ -259,7 +259,7 @@ local function genobjthumbnail(objid, fname, maxsize)
local tempfn = "/tmp/ikibooruthumb" .. b256toreadable(Rand.bytes(16)) .. ".jpg" local tempfn = "/tmp/ikibooruthumb" .. b256toreadable(Rand.bytes(16)) .. ".jpg"
local destfn = urltophysical("/objd/" .. objhex .. "/.thumb.jpg") local destfn = urltophysical("/objd/" .. objhex .. "/.thumb.jpg")
local ret, killa, exitcode = os.execute("magick convert " .. Escapes.shellescape(srcfn) .. " -background white -strip -interlace Plane -sampling-factor 4:2:0 -flatten -define jpeg:extent=100kb " .. Escapes.shellescape(tempfn)) local ret, killa, exitcode = os.execute(BigGlobe.cfg.magickprefix .. "convert " .. Escapes.shellescape(srcfn) .. " -background white -strip -interlace Plane -sampling-factor 4:2:0 -flatten -define jpeg:extent=100kb " .. Escapes.shellescape(tempfn))
if not ret or killa ~= "exit" or exitcode ~= 0 then return false end if not ret or killa ~= "exit" or exitcode ~= 0 then return false end
if LFS.attributes(tempfn).size > maxsize then if LFS.attributes(tempfn).size > maxsize then