Socket
Book a DemoInstallSign in
Socket

img-reduce-size-js

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

img-reduce-size-js

Reduce image using js

1.4.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

img-resize-js

image resize using js. reduce image size and ready to upload. image resize and return BLOB can be converted into Base64

NPM

Installation

npm install --save img-reduce-size-js

Also available to install globally:

npm install --global img-reduce-size-js

Usage

To include img-reduce-size-js on your website or npm application, use any of the following methods.

ES5

const { imageResize } =  require("img-reduce-size-js");

ES6

import { imageResize } from "img-reduce-size-js"
    imageResize({
        file: e.target.files[0],
        maxSize: 500
        }).then(function (resizedImage) {
            console.log("upload resized image", resizedImage)
        }).catch(function (err) {
            console.error(err);
        });

FOR BASE64

        imageResize({
            file: e.target.files[0],
            maxSize: 500
            }).then(function (blob) {
            var reader = new FileReader();
            reader.readAsDataURL(blob);
            reader.onloadend = function () {
                var base64data = reader.result;
                console.log(base64data);
            }
            }).catch(function (err) {
            console.error(err);
            });

License

Apache-2.0. Copyright (c) Arsalan Akhtar, Inc.

Keywords

Resize

FAQs

Package last updated on 14 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.