Last active
January 31, 2017 06:45
Revisions
-
venkatchm renamed this gist
Jan 31, 2017 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,10 +11,10 @@ guard let _transformation = transformation else { return nil } let options = ["type": "fetch", "transformation": _transformation, "sign_url": "YES", "secure": true] as [String : Any] let convertedURL = cloudinary?.url(_imageUrl, options: options) return URL(string: convertedURL!) -
venkatchm created this gist
Jan 31, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ static func getCroppedImageUrl(imageUrl: String?, width: CGFloat, height: CGFloat) -> URL? { guard let _imageUrl = imageUrl else { return nil } do { let cloudinary = try CLCloudinary(url: Configuration.cloudinaryURL()) let transformation = CLTransformation() transformation?.width = width transformation?.height = height guard let _transformation = transformation else { return nil } let options = [CloudinaryConstants.accessType: CloudinaryConstants.fetch, CloudinaryConstants.transformation: _transformation, CloudinaryConstants.signURL: CloudinaryConstants.isSignURL, CloudinaryConstants.secure: true] as [String : Any] let convertedURL = cloudinary?.url(_imageUrl, options: options) return URL(string: convertedURL!) } catch { return nil } }