1.0.8 • Published 3 years ago

rn-image-select-compress v1.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

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'}
        />
1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago