npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@capacitor-community/image-manipulator

v7.0.0

Published

The Image Manipulator plugin is designed to manipulate images (resize, compress, crop etc.)

Readme

Table of Contents

Maintainers

| Maintainer | GitHub | Active | | ---------- | ------------------------------- | ------ | | ryaa | ryaa | yes |

About

This capcitor plugin allows reading image dimensions (width and height) and resize images. This plugin is inspired and similar to cordova-plugin-image-resizer plugin. Please note that it does not depend on cordova-plugin-camera plugin and can be used independently.

Features:

  • supports getting image dimensions
  • supports resizing image
  • supports Android and iOS platforms

NOTE: The plugin version 7.0.0 is compatible with Capacitor 7

Plugin versions

| Capacitor version | Plugin version | | ----------------- | -------------- | | 7.x | 7.x | | 6.x | 6.x |

Supported Platforms

  • iOS
  • Android

Install

npm install @capacitor-community/image-manipulator
npx cap sync

API

getDimensions(...)

getDimensions(options: GetDimensionsOptions) => Promise<{ width: number; height: number; }>

Get dimensions of an image (width and height)

| Param | Type | Description | | ------------- | --------------------------------------------------------------------- | ------------------------------------- | | options | GetDimensionsOptions | options to get dimensions of an image |

Returns: Promise<{ width: number; height: number; }>

Since: 6.0.0


resize(...)

resize(options: ResizeOptions) => Promise<{ originalWidth: number; originalHeight: number; resizedWidth: number; resizedHeight: number; imagePath: string; webPath: string; resized: boolean; }>

Method to resize an image based on the provided options and return the resized image details. Please note that the resized image will respect the aspect ratio of the original image and will be resized to be equal to less of the provided maxWidth or maxHeight. If the image both width and height are less than the provided maxWidth and maxHeight, the image will not be resized and the original image details will be returned with resized as false. If either maxWidth or maxHeight is not provided or 0, this parameter will be ignored (not used) and the image will be resized based on the provided maxWidth or maxHeight, accordingly. Please note that either maxWidth or maxHeight must be provided to resize an image.

| Param | Type | Description | | ------------- | ------------------------------------------------------- | -------------------------- | | options | ResizeOptions | Options to resize an image |

Returns: Promise<{ originalWidth: number; originalHeight: number; resizedWidth: number; resizedHeight: number; imagePath: string; webPath: string; resized: boolean; }>

Since: 6.0.0


Interfaces

GetDimensionsOptions

| Prop | Type | Description | Since | | --------------- | ------------------- | -------------------------------------------- | ----- | | imagePath | string | The path to the image to get its dimensions. | 6.0.0 |

ResizeOptions

| Prop | Type | Description | Since | | ----------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------- | ----- | | imagePath | string | The path to the image to resize. | 6.0.0 | | folderName | string | (Android Only) The name of the folder to store the resized images (optional, defaults to 'ResizedImages' if not provided). | 6.0.0 | | fileName | string | The name of the resized file without extension (optional, timestamp as name if not provided). | 6.0.0 | | quality | number | The resized image quality from 0 to 100, where 100 is max (optional, defaults to 85 if not provided). | 6.0.0 | | maxWidth | number | The max width of the resized image (optional, but at least either height or width must be provided). | 6.0.0 | | maxHeight | number | The max height of the resized image (optional, but at least either width or height must be provided). | 6.0.0 | | fixRotation | boolean | Fix the rotation of the image based on EXIF metadata (optional, defaults to false if not provided). | 6.0.0 |

Usage

Please also see example-app for a complete example.

Resize image

import { ImageManipulator } from '@capacitor-community/image-manipulator';

const options: ImageResizeOptions = {
  imagePath: 'path/to/image.jpg',
  maxWidth: 300,
  maxHeight: 300,
  quality: 85,
  folderName: 'ResizedImages',
  fileName: 'resized',
  fixRotation: true
};
const result = await ImageManipulator.resize(options);

Resize image

import { ImageManipulator } from '@capacitor-community/image-manipulator';

const options: GetDimensionsOptions = {
  imagePath: 'path/to/image.jpg'
};
const result = await ImageManipulator.getDimensions(options);