0.3.3 • Published 7 months ago

@corasan/image-compressor v0.3.3

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@corasan/image-compressor

@corasan/image-compressor is a React Native module that allows you to compress images using OpenCV. Built with Nitro Modules.

Installation

You will need to install react-native-nitro-modules in your app.

yarn add @corasan/image-compressor react-native-nitro-modules
npm install @corasan/image-compressor react-native-nitro-modules
bun add @corasan/image-compressor react-native-nitro-modules

Add the plugin to your app.json file:

{
  "expo": {
    "plugins": [
      "@corasan/image-compressor"
    ]
  }
}

If you're using Expo, you will need to run expo prebuild before building your app.

Note: You might need to add the right permissions to your app.json.

{
  "expo": {
    "plugins": [
      "@corasan/image-compressor",
      [
        "expo-media-library",
        {
          "photosPermission": "Allow $(PRODUCT_NAME) to access your photos.",
          "savePhotosPermission": "Allow $(PRODUCT_NAME) to save photos.",
          "isAccessMediaLocationEnabled": true
        }
      ]
    ]
  }
}

Usage

import { ImageCompressor } from '@corasan/image-compressor'

const compressedImage = ImageCompressor.compress(image, {
  quality: 0.8,
  maxWidth: 800,
})

const wasSaved = await compressedImage.save()
0.3.3

7 months ago

0.3.2

10 months ago

0.3.1

10 months ago

0.3.0

10 months ago

0.2.0

10 months ago

0.1.1

12 months ago

0.1.0

12 months ago

0.0.7

12 months ago

0.0.6

12 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago