1.0.11 • Published 2 years ago

html-canvas-img-resizer v1.0.11

Weekly downloads
4
License
MIT
Repository
github
Last release
2 years ago

html-canvas-img-resizer

Image resizer for browser with HTML5 canvas, it uses no external library only uses the HTML5 Canvas to crop the image and output base64 image data

NOTE: the width and height of the canvas is determined by the id of the div provided if the height of the div not provided the height will be calculated accordingly with respect to aspect ratio

TODO

  • Restructure the code for better readability
  • Add support for fixed width cropping

directly use in html

https://cdn.jsdelivr.net/npm/html-canvas-img-resizer/browser/html-canvas-img-resizer.min.js

use npm or yarn

npm i html-canvas-img-resizer
or
yarn add html-canvas-img-resizer

Example

Click for example

Documentation

Documentation

How to use in browser

  const imageResizer = htmlCanvasImgResizer.default(options);

options

options

return

return

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago