All Projects → AlexLittlejohn → Alcameraviewcontroller

AlexLittlejohn / Alcameraviewcontroller

Licence: mit
A camera view controller with custom image picker and image cropping.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Alcameraviewcontroller

Stickercamera
This is an Android application with camera,picture cropping,collage sticking and tagging.贴纸标签相机,功能:拍照,相片裁剪,给图片贴贴纸,打标签。
Stars: ✭ 3,109 (+53.68%)
Mutual labels:  camera, photos
Annca
Android library to simplify work with camera for video and photo with using different camera apis.
Stars: ✭ 169 (-91.65%)
Mutual labels:  camera, photos
Magicalcamera
A library to take picture easy, transform your data in different format and save photos in your device
Stars: ✭ 327 (-83.84%)
Mutual labels:  camera, photos
MCamera
CameraViewController which allows to take photos, set filters, peform image blurring and more.
Stars: ✭ 28 (-98.62%)
Mutual labels:  photos, camera
Spectaculum
A spectacular view widget for visual media content on Android
Stars: ✭ 78 (-96.14%)
Mutual labels:  camera, photos
Focus Points
Plugin for Lightroom to show which focus point was active in the camera when a photo was taken
Stars: ✭ 272 (-86.55%)
Mutual labels:  camera, photos
Simple Camera
Quick photo and video camera with a flash, customizable resolution and no ads.
Stars: ✭ 503 (-75.14%)
Mutual labels:  camera, photos
TuSDK-for-Android-demo
TuSDK Android 图像 SDK Demo
Stars: ✭ 93 (-95.4%)
Mutual labels:  photos, camera
Gncam
📷 A Swift 3 library for interacting with the camera on iOS using AVFoundation
Stars: ✭ 42 (-97.92%)
Mutual labels:  camera, photos
Media picker
A Flutter Plugin for Selecting and Taking New Photos and Videos.
Stars: ✭ 24 (-98.81%)
Mutual labels:  camera, photos
PhotosApp
React Native Photos App: AWS Amplify, AWS S3, Mobile Analytics with Pinpoint
Stars: ✭ 21 (-98.96%)
Mutual labels:  photos, camera
Swiftycam
A Snapchat Inspired iOS Camera Framework written in Swift
Stars: ✭ 1,879 (-7.12%)
Mutual labels:  camera, photos
QuickRawPicker
📷 QuickRawPicker is a free and open source program that lets you cull, pick or rate raw photos captured by your camera. It is also compatible with the XMP sidecar file used by Adobe Bridge/Lightroom/Darktable or PP3 sidecar file used by Rawtherapee.
Stars: ✭ 26 (-98.71%)
Mutual labels:  photos, camera
Android Camera2 Secret Picture Taker
Take pictures 📷 secretly (without preview or launching device's camera app) using Android CAMERA2 API
Stars: ✭ 275 (-86.41%)
Mutual labels:  camera, photos
CameraSlider
3D printed and smartphone controlled camera slider
Stars: ✭ 16 (-99.21%)
Mutual labels:  photos, camera
Rxpaparazzo
RxJava extension for Android to take images using camera and gallery and pick files up
Stars: ✭ 467 (-76.92%)
Mutual labels:  camera, photos
Agimagecontrols
cool tools for image edition
Stars: ✭ 217 (-89.27%)
Mutual labels:  camera, photos
Chafu
A photo browser and camera library for Xamarin.iOS
Stars: ✭ 36 (-98.22%)
Mutual labels:  photos, camera
Paparazzo
Custom iOS camera and photo picker with editing capabilities
Stars: ✭ 714 (-64.71%)
Mutual labels:  camera, photos
Pictureselectorlight
Picture Selector Library for Android or 图片选择器
Stars: ✭ 145 (-92.83%)
Mutual labels:  camera, photos

ALCameraViewController

A camera view controller with custom image picker and image cropping.

camera cropper library permissions

Features

  • Front facing and rear facing camera
  • Simple and clean look
  • Custom image picker with permission checking
  • Image cropping
  • Flash light
  • Zoom
  • Tap to focus

Installation & Requirements

This project requires Xcode 9 to run and compiles with swift 4

Note: This library makes use of the AVFoundation camera API's which are unavailable on the iOS simulator. You'll need a real device to run it.

CocoaPods: Add the following to your Podfile:

pod 'ALCameraViewController'

For swift 3.2 support

pod 'ALCameraViewController', '~> 2.0.3'

Carthage:

github "alexlittlejohn/ALCameraViewController"

Privacy (iOS 10)

If you are building your app with iOS 10 or newer, you need to add two privacy keys to your app to allow the usage of the camera and photo library, or your app will crash.

Add the keys below to your Info.plist, adding strings with the description you want to provide when prompting the user.

    NSPhotoLibraryUsageDescription
    NSCameraUsageDescription

Usage

To use this component couldn't be simpler. Add import ALCameraViewController to the top of your controller file.

In the viewController

let cameraViewController = CameraViewController { [weak self] image, asset in
	// Do something with your image here.
	self?.dismiss(animated: true, completion: nil)
}

present(cameraViewController, animated: true, completion: nil)

Parameters

There are a number of configurable options available for CameraViewController

init(croppingParameters: CroppingParameters = CroppingParameters(),
     allowsLibraryAccess: Bool = true,
     allowsSwapCameraOrientation: Bool = true,
     allowVolumeButtonCapture: Bool = true,
     completion: @escaping CameraViewCompletion)

The Cropping Parameters struct accepts the following parameters

init(isEnabled: Bool = false,
     allowResizing: Bool = true,
     allowMoving: Bool = true,
     minimumSize: CGSize = CGSize(width: 60, height: 60))

The success parameter returns a UIImage? and a PHAsset? for more advanced use cases. If the user canceled photo capture then both of these options will be nil

typealias CameraViewCompletion = (UIImage?, PHAsset?) -> Void

Note: To prevent retain cycles, it is best to use a [weak self] reference within the success parameter

Other usage options

You can also instantiate the image picker component by itself as well.

let croppingEnabled = true

/// Provides an image picker wrapped inside a UINavigationController instance
let imagePickerViewController = CameraViewController.imagePickerViewController(croppingEnabled: croppingEnabled) { [weak self] image, asset in
		// Do something with your image here.
	 	// If cropping is enabled this image will be the cropped version

    self?.dismiss(animated: true, completion: nil)
}

present(imagePickerViewController, animated: true, completion: nil)

For more control you can create it directly.

Note: This approach requires some familiarity with the PhotoKit library provided by apple

import Photos

let imagePickerViewController = PhotoLibraryViewController()
imagePickerViewController.onSelectionComplete = { asset in

		// The asset could be nil if the user doesn't select anything
		guard let asset = asset else {
			return
		}

    // Provides a PHAsset object
		// Retrieve a UIImage from a PHAsset using
		let options = PHImageRequestOptions()
    options.deliveryMode = .highQualityFormat
    options.isNetworkAccessAllowed = true

		PHImageManager.default().requestImage(for: asset, targetSize: PHImageManagerMaximumSize, contentMode: .aspectFill, options: options) { image, _ in
        if let image = image {
						// Do something with your image here
        }
    }
}

present(imagePickerViewController, animated: true, completion: nil)

License

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