Giter Club home page Giter Club logo

icropper's Introduction

iCropper

iCropper is an image cropper written in pure javascript without any library dependency. It aims to be simple, fast and easy to use.

DEMO: http://supnate.github.io/icropper/demo.html

alt tag

Browser support

IE 7+, Chrome, Firefox, Opera, Safari

Usage

var ic = new ICropper(
	'cropperContainer'    //Container id
	,{
		ratio: 1    //Set aspect ratio of the cropping area
		,image: 'demo.png'
		,preview: [
				'previewSmall'  //Preview node id
		]
	}
);
//use bindPreview to dynamically add preview nodes
ic.bindPreview('previewBig');

License

MIT

icropper's People

Contributors

amouillard avatar supnate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

icropper's Issues

Setting imagePreview dimensions

Hello,

Is there an api to set imagePreview dimensions?
The example demo.html shows only small preview. I want to show the same effect on a full screen size.
How can i achieve this?
Also can I set the cropping aspect ration to 16:9 ?

Any help will be highly appreciated.
Thank you :)

Add to bower

Would be great if this was on bower.io. Pretty simple to set up and it gets this package out to more people!

fix this bug

how to set a width and height for big images ? this doesn't work
<div id="cropperContainer2" class="cropperContainer" style="width: 1000px;height: 500px;"></div>
screenshot from 2018-07-25 17-35-01
screenshot from 2018-07-25 17-35-20

save

how to save result ?

Fixed Aspect Ratio?

Hi Supnate,

This looks like a great cropper, but is it possible to specify a fixed aspect ratio (rather than just square)?

Thanks!
Ash

Problem with crop area

Hi,

I've trying to use this plugin in bootstrap modal. Everything works great, but on initial crop area is sets to 0x0. I try to change params like: initialSize, minWidth, minHeight - without any luck. Crop area shows after resize top left crop area from 0x0 to any other size.

Edit: I figured that this.offsetWidth and this.offsetHeight are 0 - like image is not loaded. Checking on chrome latest and safari.

Pass image through id

In my case there's already an uploaded image which is associated with an id. Can I pass the image as id obtained from html rather than the url?

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.