mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-11 22:06:40 +10:00
share Profile with square avatar
This commit is contained in:
@@ -16,6 +16,11 @@ extension UIImage {
|
||||
return self.largestCenteredSquareImage().resizeToTargetSize(CGSize(width: radius * 2, height: radius * 2)).roundImage()
|
||||
}
|
||||
|
||||
func squareImageOfSize(size: CGFloat) -> UIImage {
|
||||
let size = floor(size - Ruler.match(.iPhoneWidths(0.5, 0.5, 1.5)))
|
||||
return self.largestCenteredSquareImage().resizeToTargetSize(CGSize(width: size, height: size))
|
||||
}
|
||||
|
||||
func largestCenteredSquareImage() -> UIImage {
|
||||
let scale = self.scale
|
||||
|
||||
|
||||
@@ -573,7 +573,8 @@ class ProfileViewController: UIViewController {
|
||||
avatarFileURL = NSFileManager.yepAvatarURLWithName(avatar.avatarFileName),
|
||||
avatarFilePath = avatarFileURL.path,
|
||||
image = UIImage(contentsOfFile: avatarFilePath) {
|
||||
thumbnail = image.roundImageOfRadius(50)
|
||||
//thumbnail = image.roundImageOfRadius(50)
|
||||
thumbnail = image.squareImageOfSize(100)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user