All Projects → avito-tech → Paparazzo

avito-tech / Paparazzo

Licence: mit
Custom iOS camera and photo picker with editing capabilities

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Paparazzo

Rxpaparazzo
RxJava extension for Android to take images using camera and gallery and pick files up
Stars: ✭ 467 (-34.59%)
Mutual labels:  camera, photos, gallery
Ypimagepicker
📸 Instagram-like image picker & filters for iOS
Stars: ✭ 3,661 (+412.75%)
Mutual labels:  camera, gallery
Magicalcamera
A library to take picture easy, transform your data in different format and save photos in your device
Stars: ✭ 327 (-54.2%)
Mutual labels:  camera, photos
Zing Gallery
基于node.js的web相册,让摄影照片的展示更加简单 Web albums based on node.js, more simple to show photography photos
Stars: ✭ 401 (-43.84%)
Mutual labels:  photos, gallery
Focus Points
Plugin for Lightroom to show which focus point was active in the camera when a photo was taken
Stars: ✭ 272 (-61.9%)
Mutual labels:  camera, photos
Android Camera2 Secret Picture Taker
Take pictures 📷 secretly (without preview or launching device's camera app) using Android CAMERA2 API
Stars: ✭ 275 (-61.48%)
Mutual labels:  camera, photos
Pickimage
Shows a DialogFragment with camera and gallery options. User can choose wich provider wants to pick images from. 📸 🖼️
Stars: ✭ 386 (-45.94%)
Mutual labels:  camera, gallery
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 (-96.36%)
Mutual labels:  photos, camera
Nanogallery2
a modern photo / video gallery and lightbox [JS library]
Stars: ✭ 488 (-31.65%)
Mutual labels:  photos, gallery
Thumbsup
Generate static HTML photo / video galleries
Stars: ✭ 493 (-30.95%)
Mutual labels:  photos, gallery
Zoomwall.js
A content-focused photo gallery using a horizontal masonry layout that scales up in lightbox mode.
Stars: ✭ 254 (-64.43%)
Mutual labels:  photos, gallery
Simple Camera
Quick photo and video camera with a flash, customizable resolution and no ads.
Stars: ✭ 503 (-29.55%)
Mutual labels:  camera, photos
MCamera
CameraViewController which allows to take photos, set filters, peform image blurring and more.
Stars: ✭ 28 (-96.08%)
Mutual labels:  photos, camera
Stickercamera
This is an Android application with camera,picture cropping,collage sticking and tagging.贴纸标签相机,功能:拍照,相片裁剪,给图片贴贴纸,打标签。
Stars: ✭ 3,109 (+335.43%)
Mutual labels:  camera, photos
PhotosApp
React Native Photos App: AWS Amplify, AWS S3, Mobile Analytics with Pinpoint
Stars: ✭ 21 (-97.06%)
Mutual labels:  photos, camera
Zlphotobrowser
Wechat-like image picker. Support select normal photos, videos, gif and livePhoto. Support edit image and crop video. 微信样式的图片选择器,支持预览/相册内拍照及录视频、拖拽/滑动选择,编辑图片/视频,支持多语言国际化等功能;
Stars: ✭ 3,962 (+454.9%)
Mutual labels:  photos, gallery
Rocket-Notes
The World's Fastest Note Taking App. Fast. Simple. Create a note in one tap! Create image and text notes directly from your home screen!
Stars: ✭ 20 (-97.2%)
Mutual labels:  photos, gallery
ImageAttachment
Example App to show how to pick an image from Camera/Gallery
Stars: ✭ 23 (-96.78%)
Mutual labels:  gallery, camera
Insgallery
📸 Instagram-like image picker for Android (一款 UI 炫酷高仿 Instagram 的图片、视频选择器)
Stars: ✭ 409 (-42.72%)
Mutual labels:  photos, gallery
React Viewer
react image viewer, supports rotation, scale, zoom and so on
Stars: ✭ 502 (-29.69%)
Mutual labels:  photos, gallery

Overview

Version License Build Status

Paparazzo is a component for picking and editing photos.

Key Features
📷 Taking photos using camera
📱 Picking photos from user's photo library
✂️ Photo cropping and rotation
💧 Applying filters to photos

Demo

Contents

Installation

There are two options to install Paparazzo using CocoaPods.

Using Marshroute:

pod "Paparazzo"

or if you don't use Marshroute and prefer not to get it as an additional dependency:

pod "Paparazzo/Core"

Usage

You can use either the entire module or photo library exclusively.

Presenting entire module

Initialize module assembly using Paparazzo.AssemblyFactory (or Paparazzo.MarshrouteAssemblyFactory if you use Marshroute):

let factory = Paparazzo.AssemblyFactory()
let assembly = factory.mediaPickerAssembly()

Create view controller using assembly's module method:

let data = MediaPickerData(
    items: items,
    autocorrectionFilters: filters,
    selectedItem: items.last,
    maxItemsCount: maxItemsCount,
    cropEnabled: true,
    autocorrectEnabled: true,
    cropCanvasSize: cropCanvasSize
)

let viewController = assembly.module(
    data: data,
    routerSeed: routerSeed,    // omit this parameter if you're using Paparazzo.AssemblyFactory
    configure: configure
)

Method parameters:

  • items — array of photos that should be initially selected when module is presenter.
  • filters — array of filters that can be applied to photos.
  • selectedItem — selected photo. If set to nil or if items doesn't contain any photo with matching identifier, then the first photo in array will be selected.
  • maxItemsCount — maximum number of photos that user is allowed to pick.
  • cropEnabled — boolean flag indicating whether user can perform photo cropping.
  • autocorrectEnabled — boolean flag indicating whether user can apply filters to photo .
  • cropCanvasSize — maximum size of canvas when cropping photos. (see Memory constraints when cropping).
  • routerSeed — routerSeed provided by Marshroute.
  • configure — closure that allows you to provide module's additional parameters.

Additional parameters of MediaPicker module

Additional parameters is described in protocol MediaPickerModule:

  • setContinueButtonTitle(_:), setContinueButtonEnabled(_:) , setContinueButtonVisible(_:) and setContinueButtonStyle(_:) allow to customize "Continue" button text and availability.
  • setAccessDeniedTitle(_:), setAccessDeniedMessage(_:) and setAccessDeniedButtonTitle(_:) allow to customize "Access Deined" view texts.
  • setCropMode(_:) allow to customize photo crop behavior.
  • onItemsAdd is called when user picks items from photo library or takes a new photo using camera.
  • onItemUpdate is called after user performed cropping.
  • onItemAutocorrect is called after applying filter.
  • onItemMove is called after moving photo.
  • onItemRemove is called when user deletes photo.
  • onFinish and onCancel is called when user taps Continue and Close respectively.

Memory constraints when cropping

When cropping photo on devices with low RAM capacity your application can crash due to memory warning. It happens because in order to perform actual cropping we need to put a bitmap of the original photo in memory. To descrease a chance of crashing on older devices (such as iPhone 4 or 4s) we can scale the source photo beforehand so that it takes up less space in memory. cropCanvasSize is used for that. It specifies the size of the photo we should be targeting when scaling.

Presenting photo library

Initialize module assembly using Paparazzo.AssemblyFactory (or Paparazzo.MarshrouteAssemblyFactory if you use Marshroute):

let factory = Paparazzo.AssemblyFactory()
let assembly = factory.photoLibraryAssembly()

Create view controller using assembly's module method:

let viewController = assembly.module(
    selectedItems: selectedItems,
    maxSelectedItemsCount: maxSelectedItemsCount,
    routerSeed: routerSeed,    // omit this parameter if you're using Paparazzo.AssemblyFactory
    configure: configure
)
  • selectedItems — preselected photos (or nil).
  • maxItemsCount — maximum number of photos that user is allowed to pick.
  • routerSeed — routerSeed provided by Marshroute.
  • configure — closure used to provide additional module setup.

Presenting mask cropper

MaskCropper is a module which provides easy way to customize cropping experience. See CroppingOverlayProvider protocol to get more details.

Initialize module assembly using Paparazzo.AssemblyFactory (or Paparazzo.MarshrouteAssemblyFactory if you use Marshroute):

let factory = Paparazzo.AssemblyFactory()
let assembly = factory.maskCropperAssembly()

Create view controller using assembly's module method:

let data = MaskCropperData(
    imageSource: photo.image,
    cropCanvasSize: cropCanvasSize
)
let viewController = assembly.module(
    data: data,
    croppingOverlayProvider: croppingOverlayProvider,
    routerSeed: routerSeed,    // omit this parameter if you're using Paparazzo.AssemblyFactory
    configure: configure
)
  • imageSource — photo that should be cropped.
  • croppingOverlayProvider — provider from CroppingOverlayProvidersFactory.
  • routerSeed — routerSeed provided by Marshroute.
  • configure — closure used to provide additional module setup.

Presenting scanner

Scanner is a module which provides easy way to handle realtime stream from camera. See ScannerOutputHandler protocol to get more details.

Demo

Initialize module assembly using Paparazzo.AssemblyFactory (or Paparazzo.MarshrouteAssemblyFactory if you use Marshroute):

let factory = Paparazzo.AssemblyFactory()
let assembly = factory.scannerAssembly()

Create view controller using assembly's module method:

let data = ScannerData(
    initialActiveCameraType: .back,
    cameraCaptureOutputHandlers: []
)
let viewController = assembly.module(
    data: data,
    routerSeed: routerSeed,    // omit this parameter if you're using Paparazzo.AssemblyFactory
    configure: configure
)
  • initialActiveCameraType — preferred camera when starting the module (front or back).
  • cameraCaptureOutputHandlers — array of handlers that confirm the ScannerOutputHandler protocol.
  • routerSeed — routerSeed provided by Marshroute.
  • configure — closure used to provide additional module setup.

UI Customization

You can customize colors, fonts and icons used in photo picker. Just pass an instance of PaparazzoUITheme to the initializer of assembly factory.

var theme = PaparazzoUITheme()
theme.shutterButtonColor = .blue
theme.accessDeniedTitleFont = .boldSystemFont(ofSize: 17)
theme.accessDeniedMessageFont = .systemFont(ofSize: 17)
theme.accessDeniedButtonFont = .systemFont(ofSize: 17)
theme.cameraContinueButtonTitleFont = .systemFont(ofSize: 17)
theme.cancelRotationTitleFont = .boldSystemFont(ofSize: 14)

let assemblyFactory = Paparazzo.AssemblyFactory(theme: theme)

ImageSource

Photos picked by user via Paparazzo is provided to you either as MediaPickerItem (when using MediaPicker module) or as PhotoLibraryItem (when using PhotoLibrary module). Both of these enitities are just wrappers around ImageSource, which is a protocol that allows you to get different image representations regardless of where it comes from. To find out how to use it go to https://github.com/avito-tech/ImageSource

Localization

You can see the list of supported languages here. If you don't see your language, we encourage you to contribute to the project by creating pull request that adds Localizable.strings file for that language.

If you're not satisfied with a string that is provided by Paparazzo, you can override it in your project. Just add Paparazzo.strings to your main bundle. Override only the strings you need (you can see an example of this in PaparazzoExample project).

License

MIT

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