Socket
Socket
Sign inDemoInstall

rn-image-select-compress

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rn-image-select-compress

# Install


Version published
Weekly downloads
3
Maintainers
1
Created
Weekly downloads
 

Readme

Source

rn-image-select-compress

Install

Before installing rn-image-select-compress you need to install react-native-image-picker and react-native-image-resizer and react-native-image-crop-picker

npm i react-native-image-picker react-native-image-resizer react-native-image-crop-picker rn-image-select-compress

In android no need any permission in AndroidManifest.xml but ios If you are allowing user to select image/video from photos, add NSPhotoLibraryUsageDescription. If you are allowing user to capture image add NSCameraUsageDescription key also. If you are allowing user to capture video add NSCameraUsageDescription add NSMicrophoneUsageDescription key also.

Demo Image for rn-image-select-compress library

Props

imageCompressValue Object Props

keydefaultvalue
width'default''default' or ImageWidth (400,500,600,etc..)
height'default'default' or ImageHeight (400,500,600,etc..)
compressFormat'JPEG''JPEG' or 'PNG'
quality1000 to 100
multipalfalsetrue or false
manualCropfalsetrue or false
videotruetrue or false
typeSelectiontruetrue or false
keytypedefaultvalue
ContainerStylestyle Obj{}View Style (Button)
ContainerTextStyl estyle Obj{}Text Style (Button Text)
typeSelectionstringbothboth or gallery or camera
SelectionButtonTextstringselect Image
modalTitlestringImage picker

Usage example

import { CustomImagePickerModal } from 'rn-image-select-compress';


 <CustomImagePickerModal
          imageSelectionOrCameraResponse={data => {
            if (Array.isArray(data)) {
              console.log(data, 'List of data response success');
            } else if (data.uri) {
              console.log(data, 'single item success response data');
            } else if (data.didCancel) {
              console.log(data, 'cancel the user');
            } else if (data.errorCode) {
              console.log(data, 'image picker error');
            } else if (data.errorMessage) {
              console.log(data, 'image picker error');
            } else if (data.message) {
              console.log(data, 'Error Message');
            }
          }}
          ContainerStyle={{
            paddingVertical: 10,
            backgroundColor: 'red',
            paddingHorizontal: 10,
            width: 200,
            borderRadius: 10,
            elevation: 3,
          }}
          ContainerTextStyle={{
            fontSize: 20,
            textAlign: 'center',
          }}
          modalTitle={'Image Selection App'}
          SelectionButtonText={'select Image'}
          imageCompressValue={{
            width: 'default',
            height: 'default',
            compressFormat: 'JPEG',
            quality: 10,
            multipal: true,
            manualCrop: true,
            video: false,
          }}
          typeSelection={'both'}
        />

Keywords

FAQs

Last updated on 16 May 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc