Skip to content

Commit

Permalink
build(husky): upgrade 🏗 (#361)
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreBrisorgueil authored Apr 29, 2021
1 parent a1b96e2 commit 1e84a52
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,10 @@
"yarn": ">=1.13.0"
},
"scripts": {
"commit": "npx git-cz",
"commit": "npx cz",
"release": "standard-version",
"release:auto": "npx semantic-release"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"devDependencies": {
"@commitlint/cli": "^12.1.1",
"@commitlint/config-conventional": "^12.1.1",
Expand Down
14 changes: 7 additions & 7 deletions waosSwift/lib/helpers/Extensions/UIImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ extension UIImage {
guard let cgImage2 = ciContext.createCGImage(resultImage, from: inputImage.extent) else { return self }
return UIImage(cgImage: cgImage2)
}

/**
* @desc lighter image
* @param {CGFloat} percentage,
*/
func lighter(by percentage: CGFloat = 30) -> UIImage? {
return self.adjust(by: abs(percentage) )
}

/**
* @desc darker image
* @param {CGFloat} percentage,
*/
func darker(by percentage: CGFloat = 30) -> UIImage? {
return self.adjust(by: -1 * abs(percentage) )
}

/**
* @desc adjust image darkness / lightness from coefficient
* @param {CGFloat} percentage,
Expand All @@ -59,7 +59,7 @@ extension UIImage {
guard let cgImage2 = ciContext.createCGImage(resultImage, from: inputImage.extent) else { return self }
return UIImage(cgImage: cgImage2)
}

/**
* @desc adjust image orientation if needed in exif
*/
Expand All @@ -75,7 +75,7 @@ extension UIImage {
return result
}
}

/**
* @desc resizeImage width max target Size
*/
Expand All @@ -85,12 +85,12 @@ extension UIImage {
let heightRatio = targetSize.height / size.height
let newSize = widthRatio > heightRatio ? CGSize(width: size.width * heightRatio, height: size.height * heightRatio) : CGSize(width: size.width * widthRatio, height: size.height * widthRatio)
let rect = CGRect(x: 0, y: 0, width: newSize.width, height: newSize.height)

UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0)
self.draw(in: rect)
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()

return newImage
}
}

0 comments on commit 1e84a52

Please sign in to comment.