GithubHelp home page GithubHelp logo

starterre / canvasresize Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robertdmunn/canvasresize

0.0 5.0 0.0 99 KB

Javascript Canvas Resize Plugin. It can work both with jQuery and Zepto. It's compatible with iOS6 and Android 2.3+

Home Page: http://gokercebeci.com/dev/canvasresize

License: Other

JavaScript 69.68% HTML 25.36% PHP 4.95%

canvasresize's Introduction

canvasResize

canvasResize is a plug-in 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

You can change image size and quality with plugin options easily.

Tested on:

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

You can check it on gokercebeci.com/dev/canvasresize.

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(){},

License

It is under MIT License and It requires binaryajax.js and exif.js (or jQuery EXIF) to work which is also under the MPL License

Developer

Goker Cebeci

Package re-org, Bower, Grunt contributions by Robert Munn [email protected]

Dependencies

NodeJS
npm
bower

If you plan on developing canvasResize, you can clone the repo or download the zip from the links at right. Once the project is on your machine go to a command prompt in the project root and type:

npm update
bower update
grunt

That will load the dependencies and make an initial build of the source.

You can also type:

grunt watch

which will leave the command running. What that does is monitor the source files for changes and run a new build when the source changes.

canvasresize's People

Contributors

davidof avatar goker-dev avatar jessieamorris avatar robertdmunn avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.