I’m asked to create a 450px by 225px image from a given image(can be any size) with following requirements.
If the image is 450×225, no porblem just save it. If the image is bigger just give the user the ability to crop the image. I’m able to do both of the above but where I’m stuck is when image is smaller than 450×225. When smaller, I want to create an 450×225 image and paste the given image on the center of 450×225.
I’m working with node.js and using the GraphicsMagicks library for node.js.
Any help is greatly appreciated!
If you want to integrate easily with node.js, you can use stdin/stdout as files:
Then, you can pipe you image data to and from the gm process.