Image picker with custom crop rect for iOS written in Swift (Ported over from GKImagePicker)

Related tags

Image WDImagePicker
Overview

WDImagePicker

Ever wanted a custom crop area for the UIImagePickerController? Now you can have it with WDImagePicker. Just set your custom crop area and that's it. Just 4 lines of code. If you don't set it, it uses the same crop area as the default UIImagePickerController.

Installation

CocoaPods

use_frameworks!

pod 'WDImagePicker', :git => 'https://github.com/justwudi/WDImagePicker.git', :tag => '0.2.2'

and run pod install

Manually

  • just drag and drop the files in under "Classes" into your project.
  • look at the sample code below.
  • this project contains a sample project as well, just have a look at the implementation of ViewController.swift

Sample Code

self.imagePicker = WDImagePicker()
self.imagePicker.cropSize = CGSizeMake(280, 90)
self.imagePicker.delegate = self

self.presentViewController(self.imagePicker.imagePickerController, animated: true, completion: nil)

This code results into the following controller + crop area:

Sample Crop Image

It's even possible to let the user adjust the crop area by setting one additional property:

self.imagePicker.resizeableCropArea = true

This code results into the following controller + adjustable crop area:

Sample Crop Image Adjustable

License

Under MIT. See license file for details.

You might also like...
FlaneurImagePicker is an iOS image picker that allows users to pick images from different sources (ex: user's library, user's camera, Instagram...).                            It's highly customizable.
FlaneurImagePicker is an iOS image picker that allows users to pick images from different sources (ex: user's library, user's camera, Instagram...). It's highly customizable.

FlaneurImagePicker is a highly customizable iOS image picker that allows users to pick images from different sources (ex: device's library, device's c

Custom iOS camera and photo picker with editing capabilities
Custom iOS camera and photo picker with editing capabilities

Overview Paparazzo is a component for picking and editing photos. Key Features 📷 Taking photos using camera 📱 Picking photos from user's photo libra

FMPhotoPicker is a modern, simple and zero-dependency photo picker with an elegant and customizable image editor
FMPhotoPicker is a modern, simple and zero-dependency photo picker with an elegant and customizable image editor

FMPhotoPicker is a modern, simple and zero-dependency photo picker with an elegant and customizable image editor Quick demo Batch select/deselect Smoo

📹 Your next favorite image and video picker
📹 Your next favorite image and video picker

Description We all love image pickers, don't we? You may already know of ImagePicker, the all in one solution for capturing pictures and selecting ima

FLImagePicker - A simple image picker supported multiple selection
FLImagePicker - A simple image picker supported multiple selection

FLImagePicker A simple image picker supported multiple selection. Features Multiple selection Gesture supported Dark mode Easy modification Installati

An image download extension of the image view written in Swift for iOS, tvOS and macOS.
An image download extension of the image view written in Swift for iOS, tvOS and macOS.

Moa, an image downloader written in Swift for iOS, tvOS and macOS Moa is an image download library written in Swift. It allows to download and show an

FacebookImagePicker is Facebook album photo picker written in Swift.
FacebookImagePicker is Facebook album photo picker written in Swift.

Features • Installation • Usage • Translation • License GBHFacebookImagePicker is Facebook's album photo picker written in Swift, built to provide a s

A Shortcuts-like and highly customizable SFSymbol picker written in Swift.
A Shortcuts-like and highly customizable SFSymbol picker written in Swift.

SFTintedIconPicker SFTintedIconPicker is a Shortcuts-like and highly customizable SFSymbol picker written in Swift. Features Native Appearance Search

AsyncImage before iOS 15. Lightweight, pure SwiftUI Image view, that displays an image downloaded from URL, with auxiliary views and local cache.

URLImage URLImage is a SwiftUI view that displays an image downloaded from provided URL. URLImage manages downloading remote image and caching it loca

Comments
  • Update for Swift 2.2 (Xcode 7.3 and later)

    Update for Swift 2.2 (Xcode 7.3 and later)

    Updates syntax for Swift 2.2, I did notice that you can't move the crop box for the Resizable Custom Crop. I don't know if this was a pre-existing bug as I don't have an older version of XCode to run the older swift syntax.

    The tests passed :wink:

    opened by Lily418 0
  • Cropping images is broken

    Cropping images is broken

    Whenever I select an image to be cropped, if the image is screenshot sized the image goes to the left corner and the crop radius is still the same size. I've attached a screenshot for clarity. Anyone else have this problem or know how to fix it? img_0632

    opened by Tom-Knighton 0
  • changing cropper ratio results in inaccurate resulting image.

    changing cropper ratio results in inaccurate resulting image.

    Default cropper has 1:1 ratio in example app i.e 280x280 and the imageview in place to show the resulting image is also of similiar ratio, but if i change the cropper ratio to 3:3.5 as per my requirement and even changed the imageview size to 288x336 to accomodate the resulting image perfectly but the image is not cropping properly and the image is cropped in a way that it takes the resulting image from top right of the original while ignoring what is given in the cropper area.

    opened by AmmarMujeeb 1
Owner
Wu Di
Wu Di
Crop faces, inside of your image, with iOS 11 Vision api.

FaceCropper Requirements Xcode 9.0 (beta) or higher. iOS 11.0 (beta) or higher. (It is possible to import this library under the iOS 11. But it won't

Taejun Kim 488 Dec 17, 2022
Simple image crop library for iOS

PhotoCropper This is a simple image crop library for iOS I made for fun on Chris

Aaron Lee 5 Jun 21, 2022
ZImageCropper is a simplest way to crop image to any shapes you like.

ZImageCropper ZImageCropper is a simplest way to crop image to any shapes you like. Example To run the example project, clone the repo, and run pod in

Mohammad Zaid Pathan 219 Dec 17, 2022
Simple UIView to interact with an Image view like scroll, zoom, pinch and crop.

Welcome to Interactive Image View, a simple library that provides an easier way to interact with image view, like scroll, zoom and crop. In its core i

Egzon Pllana 23 Nov 7, 2022
📸 iMessage-like, Image Picker Controller Provides custom features.

RAImagePicker Description RAImagePicker is a protocol-oriented framework that provides custom features from the built-in Image Picker Edit. Overview O

Rashed Al-Lahaseh 14 Aug 18, 2022
A view controller for iOS that allows users to crop portions of UIImage objects

TOCropViewController TOCropViewController is an open-source UIViewController subclass to crop out sections of UIImage objects, as well as perform basi

Tim Oliver 4.4k Jan 1, 2023
Autocrop - A face-aware crop utility using OSX's Vision framework

autocrop A high-performance face-aware crop utility using OSX's Vision framework

Alex Dong 0 Jan 19, 2022
A crop, compression, resize and trimming library for videos, based on AVKit.

VideoKit VideoKit is a high level layer on top of AVKit How it works // With this config, the video will get resized to 1920x1080p, the maximal length

Knoggl 9 Dec 24, 2022
📸 Instagram-like image picker & filters for iOS

YPImagePicker YPImagePicker is an instagram-like photo/video picker for iOS written in pure Swift. It is feature-rich and highly customizable to match

Yummypets 4k Dec 27, 2022
A very useful and unique iOS library to open image picker in just few lines of code.

ImagePickerEasy A very simple solution to implement UIImagePickerController() in your application. Requirements Swift 4.2 and above Installation Image

wajeehulhassan 6 May 13, 2022