Latest 0.1.4
Homepage https://github.com/nventify/ImagizerSwift
License APACHE
Platforms ios 9.2, osx 10.10, tvos 9.2, requires ARC
Authors

The official Swift client for the Imagizer Media Engine

The Imagizer Media Engine accelerates media delivery to your mobile Apps or Webpages by dynamically rescaling, cropping, and compressing images in real time. See all Imagizer features in our doc.

Installation for Cocoapods

use_frameworks!

target 'MyApp' do
  pod 'ImagizerSwift'
end

Installation for Carthage

github "Nventify/ImagizerSwift"

Usage

Using the free to test Imagizer Demo Service

// Import the ImagizerSwift framework
import ImagizerSwift

// Initialize the Imagizer Client
let imagizerClient = ImagizerClient()

// Since we are using Imagizer Engine Demo Service
// we'll need to specify our Image storage origin
// Imagizer will fetch your images from this endpoint
imagizerClient.originImageHost = "example.com"

// Enable Auto device pixel ratio setting.
// Device pixel ratio will now be detected
// and automatically applied to image urls
imagizerClient.autoDpr = true

// Build a URL with resize and cropping params
// http://example.com/image.jpg?width=400&height=400&crop=fit&dpr=2&hostname=example.com
let imageUrl1 = imagizerClient.buildUrl("image.jpg", params: [
  "width": 400, 
  "height": 500,
  "crop": "fit"
])

// Build url with compression 
// http://example.com/image.jpg?quality=55&hostname=example.com
let imageUrl2 = imagizerClient.buildUrl("image.jpg", params: [
  "quality": 55
])

Using your own Imagizer Instance

// Import the ImagizerSwift framework
import ImagizerSwift

// Initialize the Imagizer Client
let imagizerClient = ImagizerClient(host: "example.com")

// Enable Auto device pixel ratio setting.
// Device pixel ratio will now be detected
// and automatically applied to image urls
imagizerClient.autoDpr = true

// Build a URL with resize and cropping params
// http://example.com/image.jpg?width=400&height=400&crop=fit&dpr=2
let imageUrl1 = imagizerClient.buildUrl("image.jpg", params: [
  "width": 400, 
  "height": 500,
  "crop": "fit"
])

// Build url with compression 
// http://example.com/image.jpg?quality=55
let imageUrl2 = imagizerClient.buildUrl("image.jpg", params: [
  "quality": 55
])

Latest podspec

{
    "name": "ImagizerSwift",
    "version": "0.1.4",
    "summary": "The official swift client for the ImagizerEngine.",
    "homepage": "https://github.com/nventify/ImagizerSwift",
    "license": {
        "type": "APACHE",
        "file": "LICENSE"
    },
    "authors": {
        "Nicholas Pettas": "[email protected]"
    },
    "platforms": {
        "ios": "9.2",
        "osx": "10.10",
        "tvos": "9.2"
    },
    "requires_arc": true,
    "source": {
        "git": "https://github.com/nventify/ImagizerSwift.git",
        "tag": "v0.1.4",
        "submodules": true
    },
    "source_files": "ImagizerSwift/*.{h,m,swift}"
}

Pin It on Pinterest

Share This