Latest 0.0.9
Homepage https://github.com/guhungry/ios-photo-manipulator
License MIT
Platforms ios 9.0
Authors

iOS Photo Manipulator

Image processing library to edit image programmatically for iOS.

Installation

Add dependency Podfile

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Demo' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Add WCPhotoManipulator
  pod 'WCPhotoManipulator', :git => 'https://github.com/guhungry/ios-photo-manipulator.git', :tag => 'v0.0.8'

end

Usage UIImage+PhotoManipulator

Import using

#import <WCPhotoManipulator/UIImage+PhotoManipulator.h>

[image crop]

Crop image from specified cropRegion

NAME TYPE REQUIRED DESCRIPTION
cropRegion CGRect Yes Region to be crop in CGRect(x, y, size, width)
scale CGFloat No Scale of result image. Default = image.scale

[image resize]

Resize image from specified into targetSize using resize mode cover

NAME TYPE REQUIRED DESCRIPTION
targetSize CGSize Yes Size of result image
scale CGFloat No Scale of result image. Default = image.scale

[image drawText]

Print text into image

NAME TYPE REQUIRED DESCRIPTION
text NSString Yes Text to print in image
position CGPoint Yes Position to in in x, y
color UIColor* Yes Text color
textSize CGFloat Yes Text size
thickness Float No Outline of text. Default = 0
scale CGFloat No Scale of result image. Default = image.scale

[image overlayImage]

Overlay image on top of background image

NAME TYPE REQUIRED DESCRIPTION
overlay UIImage* Yes Overlay image
position CGPoint Yes Position of overlay image in background image

Usage FileUtils

Import using

#import <WCPhotoManipulator/FileUtils.h>

[FileUtils createTempFile]

Create temp file into cache directory with prefix

NAME TYPE REQUIRED DESCRIPTION
prefix NSString Yes Temp file name prefix
mimeType NSString Yes Mime type of image. Default = image/jpeg

[FileUtils cachePath] TO BE IMPLEMENT

Get cache path of app

[FileUtils cleanDirectory]

Delete all files in directory with prefix

NAME TYPE REQUIRED DESCRIPTION
directory NSString Yes Path to clean
prefix NSString Yes File name prefix to match

[FileUtils saveImageFile]

Save image to target path

NAME TYPE REQUIRED DESCRIPTION
image UII mage Yes Source image
mimeType NSString Yes Mime type of target file
quality CGFloat Yes Quality of image between 0 – 1(For jpg only)
file NSString Yes Target file path

[FileUtils imageFromUrl]

Open file from uri as input stream

NAME TYPE REQUIRED DESCRIPTION
uri String Yes Uri of image can be remote (https?://) or local (file://)

Usage MimeUtils

Import using

#import <WCPhotoManipulator/FileUtils.h>

[MimeUtils toExtension]

Get image file extension from mimeType (Support .jpg, .png and .webp)

NAME TYPE REQUIRED DESCRIPTION
mimeType String Yes Image mime type

Latest podspec

{
    "name": "WCPhotoManipulator",
    "version": "0.0.9",
    "summary": "An image processing library for iOS",
    "homepage": "https://github.com/guhungry/ios-photo-manipulator",
    "license": "MIT",
    "authors": {
        "Woraphot Chokratanasombat": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/guhungry/ios-photo-manipulator.git",
        "tag": "v0.0.9"
    },
    "source_files": "WCPhotoManipulator/**/*.{h,m}"
}

Pin It on Pinterest

Share This