So here’s the thing. I used to make some hobby projects - 2d games in previous years using Corona and for that it was perfect.
Now I want to use Solar2D for an app, a “shell” let’s say. The main work will be done on the server.
What I already managed to achieve:
Selecting a photo from library, sending it with POST request to my API, getting the post-processed image as response and displaying it.
What I need to do, and for know I don’t know how, is to resize the actual input photo so it’ll be lower than let’s say 2000 pixels (preserving the aspect ratio). I tried changing width and height of the display object and then saving it with this code:
local path = system.pathForFile( "input_image_resized", system.TemporaryDirectory ) local file = io.open( path, "w+b" ) file:write( input_image ) io.close( file )
But it didn’t change the actual image dimensions, same sized image is sent with POST request.
What approach should I take to achieve that? Are there native lua functions to do that? Should I create a plugin for that (no idea how to start)?
Second thing I want to achieve at the end is to merge two images (tranparent PNG on top of the second - background) and save it to gallery. Can that be easly done or should I rather look for another framework than solar2d?