html-canvas-img-resizer
TypeScript icon, indicating that this package has built-in type declarations

1.0.11 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i html-canvas-img-resizer

Weekly Downloads

4

Version

1.0.11

License

MIT

Unpacked Size

364 kB

Total Files

38

Last publish

Collaborators

  • subhash1991