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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-android-image-cropper

v0.2.4

Published

React-Native Android Image Cropper =======

Downloads

41

Readme

React-Native Android Image Cropper

Powerful (Zoom, Rotation, Multi-Source), customizable (Shape, Limits, Style), optimized (Async, Sampling, Matrix) and simple image cropping library for React-Native Android Module.

Crop

Install

npm i react-native-android-image-cropper@latest --save

Automatic Installation

react-native link

Manual Installation

  1. Add the following lines to android/settings.gradle:

    include ':react-native-android-image-cropper'
    project(':react-native-android-image-cropper').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-image-cropper/android')
  2. Add the compile line to the dependencies in android/app/build.gradle:

    dependencies {
        compile project(':react-native-android-image-cropper')
    }
  3. Add the import and link the package in MainApplication.java:

    import com.ozdevcode.theartofdev.edmodo.cropper.ImageCropperPackage; // <-- add this import
    
    public class MainApplication extends Application implements ReactApplication {
        @Override
        protected List<ReactPackage> getPackages() {
            return Arrays.<ReactPackage>asList(
                new MainReactPackage(),
                new ImageCropperPackage() // <-- add this line
                 
            );
        }
    }

Usage

import ImageCropper from "react-native-android-image-cropper";

// More info on all the options is below in the README

var options = {
  guideLines:"on-touch",
  cropShape:"rectangle",
  title:'MY EXAMPLE',
  cropMenuCropButtonTitle:'Done'
 }
 
 /**
 * The first arg is the options object for customization (it can also be null or omitted for default options),
 * The second arg is the callback which sends object: response 
 */
 
  ImageCropper.selectImage(options,(response)=>{
      //error throwns with response.error
      if(response&&response.uri){
        this.setState({imageUri:response.uri})
      }
    });

Options

Props | Default| Options/Info ------ | ---- | ------- guideLines (String)|on|off: no guidelines will be displayed. on: guidelines will always be displayed. on-touch: guidelines will be displayed when the crop window is touched. cropShape (String)|rectangle|rectangle,ovaluse FixAspectRatio for Square / Circle. title (String) |Crop Image|Set window title cropMenuCropButtonTitle (String)|Done| Set crop button's title requestedSizeHeight (int)|0|The height to resize the cropped image to requestedSizeWidth (int)|0|The width to resize the cropped image to allowCounterRotation (boolean)|false|Allow counter-clockwise rotation during cropping. Note: if rotation is disabled this option has no effect. allowFlipping (boolean) |false|Allow flipping during cropping aspectRatio (array [int,int])|[1,1]|X,Y value of the aspect ratio.* Also sets fixes aspect ratio to TRUE. transferFileToExternalDir (boolean)| false|Move cropped image from cache directory to external directory. Otherwise the image will stored in app cache folder. externalDirectoryName (String)|CropImage|Name of folder if transferFileToExternalDir is true autoZoomEnabled (boolean)|true|Auto-zoom functionality is enabled maxZoom (int)|4|The max zoom allowed during cropping fixAspectRatio (boolean)|false|Whether the width to height aspect ratio should be maintained or free to change. initialCropWindowPaddingRatio (double)|0.1| 0% - 100%. The initial crop window padding from image borders in percentage of the cropping image dimensions.Set to 0 for initial crop window to fully cover the cropping image. borderCornerThickness (double)|2|dp - Thickness of the corner line (in pixels).Set to 0 to remove. borderCornerOffset (double)|5|dp - The offset of corner line from crop window border (in pixels). Set to 0 to place on top of the border lines. borderCornerLength (double)|12| dp - The length of the corner line away from the corner (in pixels) guidelinesThickness (double)|1|dp - The thickness of the guidelines lines (in pixels) snapRadius (double)|3|dp - An edge of the crop window will snap to the corresponding edge of a specified bounding box when the crop window edge is less than or equal to this distance (in pixels) away from the bounding box edge (in pixels).Set 0 to disable snapping showCropOverlay (boolean)|true|Show crop overlay UI what contains the crop window UI surrounded by background over the cropping image minCropWindowWidthHeight (array [int,int])|[40,40]|dp - The min size the crop window is allowed to be (in pixels) minimum width/height 10 flipHorizontally|true|Whether the image should be flipped horizontally flipVertically|true|Whether the image should be flipped vertically

License

Android library from ArthurHub/Android-Image-Cropper.

Originally library forked from edmodo/cropper.

Copyright 2018 Zainoz Zaini, 2017, Arthur Teplitzki, 2013, Edmodo, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.