Heh, yeah, I figured. :D That said, those would probably be decent test cases on my end.
Anyhow, I’ve added some stuff, though I’m not able at the moment to sign in to the remote machine where I do my plugins’ non-Windows builds (there was a rather loud thunderstorm a couple hours ago…). I’ll try to do them all when I head over to the office tomorrow, perhaps with some further refinements, and push them soon after. I’ll let you know.
As for the changes, basically, after doing something like the following:
local data, w, h, bpp = impack.image.load("turtle.bmp") local w2, h2 = 400, 300 local result = impack.ops.resize\_custom(data, w, h, w2, h2, bpp)
you can then do either:
impack.write.jpg("resized.jpg", w2, h2, bpp, result)
or the more roundabout
local image = impack.image.new\_image\_object(w2, h2) local method = bpp == 3 and "set\_from\_bytes\_rgb" or "set\_from\_bytes\_rgba" -- should these be unified with a -- comp parameter? image[method](image, 1, 1, result) image:save(system.pathForFile("resized\_by\_spot.JPG", system.DocumentsDirectory)) -- todo: need to wire paths -- into the Spot methods
Obviously the first is preferable here. However, now that the latter is possible, it should be fairly easy to route any additional formats through Spot, with some minor overhead.