Add support for [png to texmod:calc_dims

This commit is contained in:
Lars Mueller 2023-05-24 21:25:55 +02:00
parent b169077a40
commit d4ca847b0e

@ -74,4 +74,9 @@ function cd:sheet(get_dims)
return math.floor(base_w / self.w), math.floor(base_h / self.h) return math.floor(base_w / self.w), math.floor(base_h / self.h)
end end
function cd:png()
local png = modlib.minetest.decode_png(modlib.text.inputstream(self.data))
return png.width, png.height
end
return calc_dims return calc_dims