All Projects → voids → Weex Image Crop Picker

voids / Weex Image Crop Picker

Licence: mit
iOS/Android image picker with support for camera, configurable compression, multiple images and cropping porting from

Projects that are alternatives of or similar to Weex Image Crop Picker

Flutter image cropper
A Flutter plugin for Android and iOS supports cropping images
Stars: ✭ 723 (+1621.43%)
Mutual labels:  crop
Croppy
Image Cropping Library for Android
Stars: ✭ 906 (+2057.14%)
Mutual labels:  crop
Smartcircle
✂️Automatically determine where to crop a circular image out of a rectangular.
Stars: ✭ 29 (-30.95%)
Mutual labels:  crop
Flyimg
Dockerized PHP7 application runs as a Microservice to resize and crop images on the fly. Get optimised images with MozJPEG, WebP or PNG using ImageMagick. Includes face detection, cropping, face blurring, image rotation and many other options. Abstract storage based on FlySystem in order to store images on any provider (local, AWS S3...).
Stars: ✭ 762 (+1714.29%)
Mutual labels:  crop
Image
A PHP library to handle images
Stars: ✭ 898 (+2038.1%)
Mutual labels:  crop
Android Image Picker
Image Picker for Android 🤖
Stars: ✭ 847 (+1916.67%)
Mutual labels:  image-picker
Arcnavigationview
Another approach to create NavigationDrawer with Material concepts
Stars: ✭ 686 (+1533.33%)
Mutual labels:  crop
Php Image Resize
PHP library to resize, scale and crop images. Cloud solution available at:
Stars: ✭ 955 (+2173.81%)
Mutual labels:  crop
Prlib
Pre-Recognition Library - library with algorithms for improving OCR quality.
Stars: ✭ 18 (-57.14%)
Mutual labels:  crop
React Native Image Picker
🌄 A React Native module that allows you to use native UI to select media from the device library or directly from the camera.
Stars: ✭ 7,431 (+17592.86%)
Mutual labels:  image-picker
Cdpimagecrop
CDPImageCrop can zoom,move and crop a image and automatically save into the album,details see demo.
Stars: ✭ 6 (-85.71%)
Mutual labels:  crop
Wosi Demo
一款用chameleon写的跨h5、小程序和native端的背单词软件
Stars: ✭ 16 (-61.9%)
Mutual labels:  weex
Weexone
Weex [one 一个]客户端
Stars: ✭ 865 (+1959.52%)
Mutual labels:  weex
React Article Bucket
总结,积累,分享,传播JavaScript各模块核心知识点文章全集,欢迎star,issue(勿fork,内容可能随时修改)。webpack核心内容部分请查看专栏: https://github.com/liangklfangl/webpack-core-usage
Stars: ✭ 750 (+1685.71%)
Mutual labels:  weex
G3d
A pure 3D render engine compatible with webgl, running both in browser and gcanvas.
Stars: ✭ 948 (+2157.14%)
Mutual labels:  weex
Gsygithubappweex
超完整的Weex开源项目,功能丰富,适合学习和日常使用。GSYGithubApp系列的优势:我们目前已经拥有Flutter、Weex、ReactNative、Kotlin四三个版本。 功能齐全,项目框架内技术涉及面广,完成度高,配套文章,适合全面学习,对比参考。开源Github客户端App,更好的体验,更丰富的功能,旨在更好的日常管理和维护个人Github,提供更好更方便的驾车体验Σ( ̄。 ̄ノ)ノ。同款Flutter版本 : https://github.com/CarGuo/GSYGithubAppFlutter 、同款React Native版本 : https://github.com/CarGuo/GSYGithubApp 、原生 kotlin 版本 https://github.com/CarGuo/GSYGithubAppKotlin
Stars: ✭ 714 (+1600%)
Mutual labels:  weex
Alloycrop
The best and tiny size mobile cropping component - 做最好且最小的移动裁剪组件
Stars: ✭ 907 (+2059.52%)
Mutual labels:  crop
Kirby Autofocus
Content aware image cropping for Kirby. Kirby 2 and 3.
Stars: ✭ 35 (-16.67%)
Mutual labels:  crop
Chameleon Sdk Android
Android系统下Chameleon SDK
Stars: ✭ 30 (-28.57%)
Mutual labels:  weex
Instagrid Js
A Javascript library to do exactly what Instagram Layout application does
Stars: ✭ 13 (-69.05%)
Mutual labels:  crop

weex-image-crop-picker

JitPack CocoaPods license

由于weex market里的weex-image-picker插件并无裁剪和多选功能,看到也是从react-native-image-picker移植来的,并且该插件原作者推荐了功能比较多的 react-native-image-crop-picker ,于是产生了此项目。

Result

Android

  • root目录的build.gradle增加jitpack的地址

    allprojects {
      repositories {
        ...
        maven { url 'https://jitpack.io' }
      }
    }
    
  • 在你的app目录的build.gradle增加一行依赖

    dependencies {
      compile com.github.voids:weex-image-crop-picker:1.0.2
    }
    // 如果提示duplicate entry,则exclude不需要的module,如下
    dependencies {
        compile('com.github.voids:weex-image-crop-picker:1.0.2') {
            exclude module: 'weex_sdk'
        }
    }
    
  • Application子类中注册module

    import cn.dv4.weeximagecroppicker.ImageCropPickerModule;
    // 在WXSDKEngine.initialize之后注册module
    WXSDKEngine.registerModule("imageCropPicker", ImageCropPickerModule.class);
    
  • 在你的WXSDKInstance所在的Activity中重载onActivityResult,否则接收不到返回结果

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
            if (mWXSDKInstance != null) {
            mWXSDKInstance.onActivityResult(requestCode, resultCode, data);
        }
    }
    
  • 如果需要使用camera,则需要手动在AndroidManifest.xml中添加一行权限

    <uses-permission android:name="android.permission.CAMERA"/>
    

iOS

  • 在Podfile增加一行依赖

    pod 'WeexImageCropPicker'
    
  • 更新依赖

    pod install
    
  • appdelegate中注册module

    #import <WeexImageCropPicker/ImageCropPicker.h>
    // 在[WXSDKEngine initSDKEnvironment] 之后注册module
    [WXSDKEngine registerModule:@"imageCropPicker" withClass:[ImageCropPicker class]];
    
  • 请在info.plist中自行添加权限

javascript

由于weex的扩展为callback,不支持promise,所以用法有些调整。

// example
var ImageCropPicker = weex.requireModule('imageCropPicker')
var options = {
    width: 300,
    height: 300,
    includeExif: true,
    mediaType: 'photo',
    cropping: true
}

export default {
    data: {
        result:""
    },
    methods: {
        gallery(e) {
            ImageCropPicker.openPicker(options, (response) => {
                // 成功返回 {code:'E_SUCCESS', data:{...}}
                this.result = JSON.stringify(response)
            })
        },
        camera(e) {
            ImageCropPicker.openCamera(options, (response) => {
                // 失败返回 {code:'E_PERMISSION_MISSING', message:'...'}
                this.result = JSON.stringify(response)
            })
        }
    }
}

options

Property Type Description
cropping bool (default false) 是否开启图片剪裁
width number 剪裁后图片的宽度,cropping为true时有效
height number 剪裁后图片的高度,cropping 为true时有效
multiple bool (default false) 是否开启多选,开启多选后裁剪功能无效
writeTempFile (ios only) bool (default true) When set to false, does not write temporary files for the selected images. This is useful to improve performance when you are retrieving file contents with the includeBase64 option and don't need to read files from disk.
includeBase64 bool (default false) 是否输出base64
includeExif bool (default false) 是否输出图片exif信息,如gps、光圈、快门速度等
cropperActiveWidgetColor (android only) string (default "#424242") When cropping image, determines ActiveWidget color.
cropperStatusBarColor (android only) string (default #424242) When cropping image, determines the color of StatusBar.
cropperToolbarColor (android only) string (default #424242) When cropping image, determines the color of Toolbar.
freeStyleCropEnabled (android only) bool (default false) Enables user to apply custom rectangle area for cropping
cropperToolbarTitle string (default Edit Photo) When cropping image, determines the title of Toolbar.
cropperCircleOverlay bool (default false) 是否裁剪时开启遮罩
disableCropperColorSetters (android only) bool (default false) When cropping image, disables the color setters for cropping library.
minFiles (ios only) number (default 1) Min number of files to select when using multiple option
maxFiles (ios only) number (default 5) Max number of files to select when using multiple option
waitAnimationEnd (ios only) bool (default true) Promise will resolve/reject once ViewController completion block is called
smartAlbums (ios only) array (supported values: ['PhotoStream', 'Generic', 'Panoramas', 'Videos', 'Favorites', 'Timelapses', 'AllHidden', 'RecentlyAdded', 'Bursts', 'SlomoVideos', 'UserLibrary', 'SelfPortraits', 'Screenshots', 'DepthEffect', 'LivePhotos', 'Animated', 'LongExposure']) (default ['UserLibrary', 'PhotoStream', 'Panoramas', 'Videos', 'Bursts']) List of smart albums to choose from
useFrontCamera (ios only) bool (default false) Whether to default to the front/'selfie' camera when opened
compressVideoPreset (ios only) string (default MediumQuality) Choose which preset will be used for video compression
compressImageMaxWidth number (default none) 图片压缩指定最大宽度
compressImageMaxHeight number (default none) 图片压缩指定最大高度
compressImageQuality number (default 1) 图片压缩质量 (取值范围 0 — 1,1为最好质量)
loadingLabelText (ios only) string (default "Processing assets...") Text displayed while photo is loading in picker
mediaType string (default any) 媒体选择类型: 'photo'=照片, 'video'=视频, 'any'=全部
showsSelectedCount (ios only) bool (default true) Whether to show the number of selected assets
showCropGuidelines (android only) bool (default true) Whether to show the 3x3 grid on top of the image during cropping
hideBottomControls (android only) bool (default false) Whether to display bottom controls
enableRotationGesture (android only) bool (default false) Whether to enable rotating the image by hand gesture
cropperChooseText (ios only) string (default choose) Choose button text
cropperCancelText (ios only) string (default Cancel) Cancel button text

参数均与react-native-image-crop-picker 文档中所列的参数保持一致

注:跟原插件的android部份一样,并未实现视频压缩,因为ffmpeg太慢并且需要licence

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].