benrob0329 wrote:PNGs can't be animated, at least not in the official specks.
zak1975 wrote:My main Problem is that this mod can not import images above a certain resolution. Any idea?
zak1975 wrote:@kaeza:
Now I found out that the images I tried to load were too big.
Trying a png with 100x100 px was able to load. Next try with a 250x250 px image ran about 1 hour and then failed.
[...]
My main Problem is that this mod can not import images above a certain resolution. Any idea?
kaeza wrote:That is weird. I tested this locally, and a test image (640x640, shown in a spoiler below) loaded fine taking about a minute. Granted, the image was scaled down; the original (1500x1000) crashed minetest itself, probably due to out of memory conditions (I'll concede the loading algorithm is not very efficient, either CPU- or memory-wise).
Again, can you upload an image known to fail? Also, what are your system specs (mainly available memory)? For reference, I have a 3GHz dual core Intel E5700, with 4G of RAM.
Hybrid Dog wrote:Is it possible to use the loadlib function to use some given library for importing images?
kaeza wrote:Hybrid Dog wrote:Is it possible to use the loadlib function to use some given library for importing images?
It is, but see the IRC mod for problems with this.
Long story short, I want the mod to be usable without having to hack around with native libs.
kaeza wrote:And I don't know why are you asking about the slashes, given that 100% of the mods out there use forward slashes and none of them fail on Windows.
dofile(minetest.get_modpath("foo").."/bar.lua")
kaeza wrote:which translates to C:\whatever\minetest\mods\foo/bar.lua
function imageloader.to_schematic(bmp, pal)
local data = { }
local datai = 1
for y = bmp.h, 1, -1 do
for x = 1, bmp.w do
local c = bmp.pixels[y][bmp.w + 1 - x]
local i = palette.bestfit_color(pal, c)
if (i == 1) and ((c.r ~= 255) or (c.g ~= 0) or (c.r ~= 255)) then
print("WARNING: wrong color taken as transparency:"
..(("at (%d,%d): [R=%d,G=%d,B=%d]"):format(x, y, c.r, c.g, c.b))
)
end
local node = pal[i].node
data[datai] = { name=node }
datai = datai + 1
end
end
return {
size = { x=bmp.w, y=bmp.h, z=1 },
data = data,
}
end
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)
Users browsing this forum: No registered users and 5 guests