Skip to content

Instantly share code, notes, and snippets.

View shellophobia's full-sized avatar

Suman Anand shellophobia

View GitHub Profile

Upload Images with Compression on Front-End

Its a plugin that enables you upload image files to the server with a front-end side compression using javascript. So basically the image that you upload gets redrawn on the canvas with new dimension that you specify in the options and a compressed base64 encoded string is obtained from it. Now most of us these days have a phone with a fancy camera, that clicks the images of sizes of around 8-13 MB. So uploading that kind of size onto the server is totally not acceptable. So you wish to either compress on front end side or the server side. Android has some libraries that allows you to compress the files before sending onto the server, but on the other hand there is no such solid lead available on the browser side.

So here's a plugin that comes to the rescue.

The logic behind compression is that the larger size images have ample amount of resolution to them, but most of the time that kind of resolution is not needed. So this plugin is basically resizing the high

@shellophobia
shellophobia / vuejs.md
Last active July 15, 2016 10:43
Setup doc for Vuejs

#SETUP Vue.js

For local setup

  1. Install Node and npm on your machine.
    http://blog.teamtreehouse.com/install-node-js-npm-mac
    
  2. Install Gulp using the command
@shellophobia
shellophobia / UploadFilesCompress.md
Last active April 15, 2018 17:18
Upload Images with compression on front end

Upload Images with Compression on Front-End

Its a plugin that enables you upload image files to the server with a front-end side compression using javascript. So basically the image that you upload gets redrawn on the canvas with new dimension that you specify in the options and a compressed base64 encoded string is obtained from it. Now most of us these days have a phone with a fancy camera, that clicks the images of sizes of around 8-13 MB. So uploading that kind of size onto the server is totally not acceptable. So you wish to either compress on front end side or the server side. Android has some libraries that allows you to compress the files before sending onto the server, but on the other hand there is no such solid lead available on the browser side.

So here's a plugin that comes to the rescue.

The logic behind compression is that the larger size images have ample amount of resolution to them, but most of the time that kind of resolution is not needed. So this plugin is basically resizing the high