New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@awesome-cordova-library/image-resizer

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@awesome-cordova-library/image-resizer

Cordova Plugin For Image Resize.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

id: image-resizer title: Image Resizer tags:

  • cordova
  • capacitor
  • ionic
  • javascript
  • typescript
  • plugin
  • mobile
  • image
  • resize
  • compress

Image Resizer

Cordova Plugin For Image Resize.

Online documentation

Github documentation

Installation

Cordova

# This plugin uses the cordova-plugin-camera
cordova plugin add cordova-plugin-camera

# This plugin
cordova plugin add info.protonet.imageresizer

npm install @awesome-cordova-library/image-resizer

Capacitor / Ionic

# This plugin uses the cordova-plugin-camera
cordova plugin add cordova-plugin-camera

# This plugin
cordova plugin add info.protonet.imageresizer

npm install @awesome-cordova-library/image-resizer
npx cap sync

Vanilla

Declaration

export declare type OptionsImageResizer = {
  uri: string;
  folderName?: string;
  fileName: string;
  quality: number;
  width: number;
  height: number;
  base64?: boolean;
  fit?: boolean;
};
/**
 * @author AZOULAY Jordan<jazoulay@joazco.com>
 * Cordova Plugin For Image Resize.
 * Also, check out {@link https://github.com/JoschkaSchulz/cordova-plugin-image-resizer Github}
 * @requires module:cordova-plugin-camera
 */
export default class ImageResizer {
  static resize(options: OptionsImageResizer, success: (image: string) => void, error: () => void): void;
  static warnPluginIsUnInstallOrIncompatible(): void;
}

Usages

import ImageResizer from '@awesome-cordova-library/image-resizer';
const options = {
  uri: uri,
  folderName: 'Protonet Messenger',
  quality: 90,
  width: 1280,
  height: 1280,
  base64: true,
  fit: false,
};
ImageResizer.resize(
  options,
  function (image) {
    // success: image is the new resized image
  },
  function () {
    // failed: grumpy cat likes this function
  },
);

React

Declaration

declare const useImageResizer: () => (options: OptionsImageResizer) => Promise<string>;
export default useImageResizer;

Usages

import {useMemo} from "react";
import useImageResizer from '@awesome-cordova-library/image-resizer/lib/react';

function App() {
  const resize = useShake();
  const options = useMemo({
    uri: "path/to/my/image",
    folderName: 'Protonet Messenger',
    quality: 90,
    width: 1280,
    height: 1280,
    base64: true,
    fit: false,
  }, []);

  return <div>
    <button onClick={resize(options).then((image) => {
      console.log(image);
    })}>
  </div>;
}

Keywords

FAQs

Package last updated on 08 Sep 2023

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc