All Projects → chengzichen → Krgallery

chengzichen / Krgallery

Licence: gpl-2.0
Crop , Video, Photos, from Telegram

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Krgallery

Rxpaparazzo
RxJava extension for Android to take images using camera and gallery and pick files up
Stars: ✭ 467 (+302.59%)
Mutual labels:  photos, crop
Fmphotopicker
A modern, simple and zero-dependency photo picker with an elegant and customizable image editor
Stars: ✭ 428 (+268.97%)
Mutual labels:  photos, crop
Igrphototweaks
Drag, Rotate, Scale and Crop
Stars: ✭ 212 (+82.76%)
Mutual labels:  photos, crop
Phototweaks
Drag, Rotate, Scale and Crop
Stars: ✭ 1,214 (+946.55%)
Mutual labels:  photos, crop
Kepka
Unofficial Telegram Desktop messaging app
Stars: ✭ 109 (-6.03%)
Mutual labels:  telegram
Botogram
Just focus on your bots.
Stars: ✭ 106 (-8.62%)
Mutual labels:  telegram
Telegram Qt
Qt-based library for Telegram network
Stars: ✭ 105 (-9.48%)
Mutual labels:  telegram
Bimg
Go package for fast high-level image processing powered by libvips C library
Stars: ✭ 1,394 (+1101.72%)
Mutual labels:  crop
Telegram media downloader
Download media files from a telegram conversation/chat/channel up to 2GiB
Stars: ✭ 113 (-2.59%)
Mutual labels:  telegram
Devops chats
Repository of DevOps (RUS) chats in Telegram
Stars: ✭ 111 (-4.31%)
Mutual labels:  telegram
Grammers
(tele)gramme.rs - use Telegram's API from Rust
Stars: ✭ 109 (-6.03%)
Mutual labels:  telegram
Zanzara
Asynchronous PHP Telegram Bot Framework built on top of ReactPHP
Stars: ✭ 107 (-7.76%)
Mutual labels:  telegram
Treact
📢 Telegram React application (TDLIB VERSION IS BEING WORKED ON!)
Stars: ✭ 110 (-5.17%)
Mutual labels:  telegram
React Cropper
Cropperjs as React component
Stars: ✭ 1,600 (+1279.31%)
Mutual labels:  crop
Moul
The minimalist publishing tool for photographers
Stars: ✭ 113 (-2.59%)
Mutual labels:  photos
React Native Photo Gallery
Simple, yet powerful image gallery for React Native. Features zoom and pagination ! 🖼
Stars: ✭ 105 (-9.48%)
Mutual labels:  photos
Gaanabot
Telegram bot to download songs and also to find lyrics for songs.
Stars: ✭ 108 (-6.9%)
Mutual labels:  telegram
Novagram
An Object-Oriented PHP library for Telegram Bots
Stars: ✭ 112 (-3.45%)
Mutual labels:  telegram
Mattata
A powerful, plugin-based, multi-purpose Telegram bot designed to serve a wide variety of purposes
Stars: ✭ 107 (-7.76%)
Mutual labels:  telegram
Krop
Small widget for image cropping in Instagram-like style
Stars: ✭ 107 (-7.76%)
Mutual labels:  crop

KrGallery

Crop , Video, Photos, from Telegram

一个集拍照和选择图片,裁剪,录制视频和选择视频的强大且流畅简洁的库。

KrGallery摘取于Telegram,基于@TelegramGallery开发,快速,高效,低耗,轻量级,使用简单。

功能

  • 快速,高效,低耗
  • 简易的整合,轻量级
  • 基本没有依赖于任何的三方库
  • 集拍照,选择图片,裁剪,录制视频和选择视频为一体

安装

Download

  • 方式一:

Step 1. 在根目录的gradle文件中配置

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

step2 添加依赖:

dependencies {
     compile 'com.github.chengzichen:KrGallery:v1.03'
}
  • 方式二:

Step 1. 在根目录的gradle文件中配置

	allprojects {
			repositories {
				...
				 jcenter()
			}
		}

step2 添加依赖:

dependencies {
	      compile 'com.dhc.krgallery:gallerylib:1.0.3'
	}

效果

Image text Image text Image text Image text

用途

选择图片

  • 单选(type:GalleryConfig.SELECT_PHOTO)

      GalleryHelper
      .with(MainActivity.this)			//Activity or Fragment
      .type(GalleryConfig.SELECT_PHOTO)   //选择类型
      .requestCode(12)					//startResultActivity requestcode 自己定义
      .singlePhoto()						//选择单张图片
      .execute();
    
  • 多选(type:GalleryConfig.SELECT_PHOTO)

      GalleryHelper
      .with(MainActivity.this)			//Activity or Fragment
      .type(GalleryConfig.SELECT_PHOTO)	//选择类型
      .requestCode(12)					//startResultActivity requestcode 自己定义
      .limitPickPhoto(9)					//图片选择张数
      .execute();
    
  • 需要裁剪图片

      String outputPath = StorageUtil.getWritePath(StorageUtil.get32UUID() + ".jpg", StorageType.TYPE_TEMP);//定义裁剪图片输出在sdcard的位置
    
      GalleryHelper
      .with(MainActivity.this)			//Activity or Fragment
      .type(GalleryConfig.SELECT_PHOTO)   //选择类型
      .requestCode(12)					//startResultActivity requestcode 自己定义
      .singlePhoto()						//选择单张图片
      .isNeedCropWithPath(outputPath)		//需要裁剪并输出图片的路径,没有传入时返回数据为byte[]
      .execute();	
    

拍照

  • 拍照

      GalleryHelper
      .with(MainActivity.this)   			//Activity or Fragment
      .type(GalleryConfig.TAKE_PHOTO)		//选择类型,拍照
      .requestCode(12)					//startResultActivity requestcode 自己定义
      .execute();	
    
  • 需要裁剪图片

       outputPath = StorageUtil.getWritePath(StorageUtil.get32UUID() + ".jpg", StorageType.TYPE_TEMP);
       GalleryHelper
      .with(MainActivity.this)			//Activity or Fragment
      .type(GalleryConfig.TAKE_PHOTO)		//选择类型
      .isNeedCropWithPath(outputPath)		//需要裁剪并输出图片的路径,没有传入时返回数据为byte[]
      .requestCode(12)					//startResultActivity requestcode 自己定义
      .execute();
    

    onActivityResult

获取图片

在Acitivity 或者Fragment 中onActivityResult 方法

	String path = dataIntent.getStringExtra(GalleryActivity.PHOTOS);

注意 : 需要裁剪并输出图片的路径,没有传入时返回数据为byte[]

	byte[] datas =dataIntent.getByteArrayExtra(GalleryActivity.DATA);

录制视频(可限制录制时间)

	 GalleryHelper
	.with(MainActivity.this)    	//Activity or Fragment
	.type(GalleryConfig.RECORD_VEDIO)//选择类型
	.requestCode(12)				//startResultActivity requestcode 自己定义
	.limitRecordTime(10)            //定义录制视频时间
	.limitRecordSize(10)            //定义录制视频时间
	.execute();

选择视频

	 GalleryHelper
	.with(MainActivity.this)	 	//Activity or Fragment	
	.type(GalleryConfig.SELECT_VEDIO)//Activity or Fragment	
	.requestCode(12)				//startResultActivity requestcode 自己定义
	.isSingleVedio()				//是否是单选视频
	.execute();

获取视频

在Acitivity 或者Fragment 中onActivityResult 方法

	String path = data.getStringExtra(GalleryActivity.VIDEO);

注意

  • 需要裁剪并输出图片的路径,没有传入时返回数据为byte[]
  • 选取多张图片时裁剪只对第一张照片有效
  • 选着视频目前支持单个视频

API说明

  • GalleryHelper

      1. with()    										//Activity or Fragment
      2. type(int type)  
      	1.  GalleryConfig.SELECT_PHOTO  				//选择图片
      	2.  GalleryConfig.TAKE_PHOTO 					//拍照
      	3.  GalleryConfig.RECORD_VEDIO					//录制视频
      	4.  GalleryConfig.SELECT_VEDIO					//选择单个视频
      	5.  GalleryConfig.TAKEPHOTO_RECORDVEDIO 		//拍照和录制视频
      3. requestCode(int code) 				 			//startResultActivity requestcode 自己定义
      4. isSingleVedio()    								//选择单个视频,必须调用方法
      5. isNeedCropWithPath() 							//进行裁剪图片  返回一个传入路径值
      6. isNeedCrop()										//需要裁剪图片 这将返回一个  byte[] data数据类型
      7. selectVedioWithMimeTypes()						//filter of media type, based on MimeType standards:{http://www.w3school.com.cn/media/media_mimeref.asp}<Li>eg:new string[]{"image/gif","image/jpeg"}
      8. hintOfPick()										//hint of Toast when limit is reached
      9. singlePhoto()									//选择单张照片
      10. limitPickPhoto(int)  							//hint of Toast when limit is reached
      11. limitRecordTime(int)                            //限制视频录制的时间
      11. execute()
    

TODO

  • 修改部分样式
  • 自定义主题
  • 视频的编辑
  • 图片的编辑
  • 提供压缩
  • 优化代码

作者

感谢

@Telegram

@TelegramGallery

友情链接

@XDroid 老司机

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].