Open the project’s app.js file and include the following:Īpp.post("/process", Multer(). It makes sense to add our boilerplate code for bootstrapping our API before we worry ourselves with the heavy lifting of image manipulations. With the project created, let’s dive into some code. Including the Application Logic for Jimp, Bluebird, and File Archiving Since everything we do is asynchronous, we’ll need the help of the bluebird package to turn things into promises and monitor them. The jimp package will allow us to do image manipulations with JavaScript and the node-zip package will allow us to create ZIP archives. More information on receiving files in an Express based project can be found in an article I wrote titled, Upload Files to a Minio Object Storage Cloud with Node.js and Multer. A screen-grab of icons generated with all ouptut options enabled. Load artwork &srarr choose options &srarr export for a tidy collection of files 'ready to go' into your development environment. To receive files, we’ll need the multer package. Generate system icons from a single SVG, PNG, BMP, GIF, or JPG image. To receive POST bodies, we’ll need the body-parser package. We’ll be serving an API, hence the express package. If you don’t have the touch command, create the file however you see fit.īefore we start development, let’s have another look at those dependencies.
HOW TO USE ANDROID APP ICON GENERATOR INSTALL
The above commands will initialize a new project with a package.json file, install our dependencies, and create an app.js file to hold our logic. Npm install express body-parser multer bluebird jimp node-zip -save With Node.js installed, execute the following from somewhere on your computer: To be successful with this project, it will help to start fresh. We’re going to accomplish this task with Node.js and Express.
HOW TO USE ANDROID APP ICON GENERATOR HOW TO
We’re going to see how to create a RESTful API that accepts an image and generates various sizes of that same image, bundled within a ZIP archive. Since we’re talented developers, we’re going to create our own service this time around. If you’ve been keeping up, you’ll remember I wrote about image generators in an article titled, Generating Splash Screens and Application Icons for NativeScript Mobile Apps. Instead, it makes sense to use or create a script for this. Once you’ve got your icon, resampling or resizing it for each possible screen density can become a pain in the butt. If you’re not too familiar with Android, there are mdpi, hdpi, xhdpi, xxhdpi, and xxxhdpi densities as of now. When you’re developing an Android mobile application, it is critical that you come up with a nice launcher icon for all possible Android screen densities.