All Projects → Roylee-ML → Prismasimpleimagepicker

Roylee-ML / Prismasimpleimagepicker

Licence: mit
This is a copy of the Prisma APP. Reproduce Prisma custom camera, image picker and picture editor

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Prismasimpleimagepicker

prettier-plugin-prisma
Prettier plugin for Prisma
Stars: ✭ 102 (-82.83%)
Mutual labels:  prisma
Pictureselector
🔥 Android 图片选择器(仿 IOS 图片选择控件)
Stars: ✭ 287 (-51.68%)
Mutual labels:  image-picker
Imagepicker
完全仿微信的图片选择,并且提供了多种图片加载接口,选择图片后可以旋转,可以裁剪成矩形或圆形,可以配置各种其他的参数
Stars: ✭ 4,225 (+611.28%)
Mutual labels:  image-picker
boilerplate
Fullstack boilerplate using Typescript, React, Node & GraphQL
Stars: ✭ 738 (+24.24%)
Mutual labels:  prisma
prisma-tgql-types-gen
◭ Prisma generator for generating TypeGraphQL class types and enums with allowing to edit the generated output without being overwritten 💪
Stars: ✭ 32 (-94.61%)
Mutual labels:  prisma
Chiliphotopicker
Photo picker library for android. Let's you pick photos directly from files, or navigate to camera or gallery.
Stars: ✭ 333 (-43.94%)
Mutual labels:  image-picker
gin-rest-prisma-boilerplate
🍱 backend with gin (golang web framework), redis, prisma, rbac, and authentication
Stars: ✭ 25 (-95.79%)
Mutual labels:  prisma
React Native Syan Image Picker
React-Native 多图片选择 支持裁剪 压缩
Stars: ✭ 556 (-6.4%)
Mutual labels:  image-picker
platforms
A template for site builders and low-code tools.
Stars: ✭ 1,156 (+94.61%)
Mutual labels:  prisma
Insgallery
📸 Instagram-like image picker for Android (一款 UI 炫酷高仿 Instagram 的图片、视频选择器)
Stars: ✭ 409 (-31.14%)
Mutual labels:  image-picker
goprisma
A Go wrapper for prisma to turn databases into GraphQL APIs using Go.
Stars: ✭ 54 (-90.91%)
Mutual labels:  prisma
Abra
Your next favorite image and video picker from Gallery for Swift
Stars: ✭ 19 (-96.8%)
Mutual labels:  image-picker
Ypimagepicker
📸 Instagram-like image picker & filters for iOS
Stars: ✭ 3,661 (+516.33%)
Mutual labels:  image-picker
uzual-mobile
Feed your brains with habits for a better mood
Stars: ✭ 67 (-88.72%)
Mutual labels:  prisma
Fishbun
🐡FishBun is Image Picker for android.
Stars: ✭ 508 (-14.48%)
Mutual labels:  image-picker
nestjs-prisma-starter
Starter template for NestJS 😻 includes GraphQL with Prisma Client, Passport-JWT authentication, Swagger Api and Docker
Stars: ✭ 1,107 (+86.36%)
Mutual labels:  prisma
Awesome Prisma
A collection of awesome things regarding Prisma ecosystem.
Stars: ✭ 310 (-47.81%)
Mutual labels:  prisma
Alerts And Pickers
Advanced usage of UIAlertController and pickers based on it: Telegram, Contacts, Location, PhotoLibrary, Country, Phone Code, Currency, Date...
Stars: ✭ 5,267 (+786.7%)
Mutual labels:  image-picker
Nestjs Prisma Starter
Starter template for NestJS 😻 includes GraphQL with Prisma Client, Passport-JWT authentication, Swagger Api and Docker
Stars: ✭ 547 (-7.91%)
Mutual labels:  prisma
Shop
🛍🛒 Full-stack React/Prisma/TS/GraphQL E-Commerce Example
Stars: ✭ 359 (-39.56%)
Mutual labels:  prisma

PrismaSimpleImagePicker

Logo

Custom camera, image picker ,image editor and the interface just like Prisma's style.

Overview

OverView1 OverView2 OverView3

Introduction

This is just a client function copy of Prisma, not a pod solution

Prisma is a sucessful APP of photo editing, but it's success is more than just art. And the details of the Prisma is also very good. So, I try to reproduce the client function of Prisma use Swift, and the result is this project.

This is build with Storyboard and xib, just because the Prisma is also used Storyboard and xib. The follow is the struct:

Struct

What is the use of this project?

Firstly, we can learn how to custom camera use framework AVFoundation.

  • AVCaptureSession A session to manage camera, responsible for the video image management function
  • AVCaptureDeviceInput Do the image acquisition
  • AVCaptureStillImageOutput Function for image stream output
  • AVCaptureVideoPreviewLayer Video preview layer, used to display the scene of the camera in real time

There is one thing we need to pay attention when we custom a camera, it's the image's orientation. Because the normal orientation of iPhone camera is lanscape left(Home button on the right), so the image orientation is different from our expected result. Below is a comparison.

Camera position

Secondly, from this project we can learn about some kowledge of system photo album. Because just support iOS8 above, so I use framework Photos to complete photo select, not the AssetsLibrary frmawork Prisma used. And below is the frameworks Prisma used.

Frameworks

Finally, we could just use the image picker in foder PrismaImagePicker, this is an independent function for developer jsut want to have a image picker with Prisma's syle.

More details, please view my blog(Only Chinese supported)

How to use PrismaImagePicker?

  • Create an object of class PMImagePickerController, and just present it from your own view controller.
  • If you just have the data source before, you can set the data source of PMImagePickerController, so it can be fast because without read the photo album.
  • Conform to protocol PMImagePickerControllerDelegate, and implement the delegate used.

The PMImagePickerControllerDelegate

@objc protocol PMImagePickerControllerDelegate: NSObjectProtocol {
    /**
     Call when tap `Use` button of the picker view controller
     
     - parameter picker: The view controller of class PMImagePickerController
     - parameter image:  An cropped image which displayed in the top header after edit
     */
    optional func imagePickerController(picker: PMImagePickerController, didFinishPickingImage image: UIImage)
    
    /**
     Call when tap `Use` button of the picker view controller
     
     - parameter picker:        The view controller of class PMImagePickerController
     - parameter originalImage: An original image which displayed in the top header
     - parameter selectedRect:  A rect displayed of the header
     - parameter zoomScale:     ZoomScale of the image
     */
    optional func imagePickerController(picker: PMImagePickerController, didFinishPickingImage originalImage: UIImage, selectedRect: CGRect, zoomScale:CGFloat)
    
    /**
     Call when tap `Cancel` button of the picker view controller
     
     - parameter picker: The view controller of class PMImagePickerController
     */
    optional func imagePickerControllerDidCancel(picker: PMImagePickerController)
}

Create and use the iamge picker
// Create image picker
@IBAction func selectPhoto(sender: AnyObject) {
    let nav = PMImagePickerController.init()
    nav.pmDelegate = self
    nav.photoGroups = photoGroups
    nav.photoAssets = photoAssets
    weak var weakSelf = self
    self.presentViewController(nav, animated: true) {
        weakSelf!.session.stopRunning()
    }
}


// PMImagePickerControllerDelegate
func imagePickerController(picker: PMImagePickerController, didFinishPickingImage originalImage: UIImage, selectedRect: CGRect, zoomScale:CGFloat) {
    // Do something with the original image
    ...
}
    
func imagePickerController(picker: PMImagePickerController, didFinishPickingImage image: UIImage) {
    // Dow something with the cropped image
    ...
}

func imagePickerControllerDidCancel(picker: PMImagePickerController) {
    session.startRunning()
}

Custom your own album kind

The default album is CameraFavoritesScreenShots and User photos, and all the operations of image is in PMImageManger.swift.

If you want change the kind of album, you could change the parameters PHAssetCollectionType and PHAssetCollectionSubtype in function class func photoLibrarys() -> [PHAssetCollection]

License

PrismaSimpleImagePicker is available under the MIT license. See the LICENSE file for more info.

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