![]() ![]() 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. To receive files, we’ll need the multer package. ![]() 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. 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. ![]() 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |