SAMPLE

jQuery canvasResize v1.2.0


canvasResize is a plugin for client side image resizing.

It's compatible with iOS6 It can work both with jQuery and Zepto

I fixed iOS6 Safari's image file rendering issue for large size image (over mega-pixel) using few functions from ios-imagefile-megapixel
And fixed orientation issue by using exif-js

* Sorry, server side uploading option does not work on gokercebeci.com. You can test it on your own server.

I've only tested it on

  • Chromium (24.0.1312.56),
  • Google Chrome (25.0.1364.68 beta),
  • Opera (12.14),
  • IOS 6.1.2

and it works enough for me for now!

It is under MIT License and It requires "binaryajax.js" and "exif.js" to work which is also under the MPL License [http://www.nihilogic.dk/licenses/mpl-license.txt]

developer goker.cebeci, the developer

github fork it on github

canvasResize

Choose file

USAGE


$('input[name=photo]').change(function(e) {
    var file = e.target.files[0];
    canvasResize(file, {
                width: 300,
                height: 0,
                crop: false,
                quality: 80,
                //rotate: 90,
                callback: function(data, width, height) {
                    $(img).attr('src', data);
                }
    });
});
                

OPTIONS


width    : 300,     // Image width.
height   : 0,       // Image height, default 0 (flexible).
crop     : false,   // default false.
quality  : 80,      // Image quality default 80.
rotate   : 90,      // Image rotation default 0
callback : function(){},