mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-10 21:36:49 +10:00
fix thumbnailHeight
This commit is contained in:
@@ -125,6 +125,7 @@ class YepConfig {
|
||||
static let imageWidth = "image_width"
|
||||
static let imageHeight = "image_height"
|
||||
static let blurredThumbnailString = "blurred_thumbnail_string"
|
||||
static let thumbnailMaxSize: CGFloat = 100
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2409,17 +2409,17 @@ extension ConversationViewController: UIImagePickerControllerDelegate, UINavigat
|
||||
let thumbnailHeight: CGFloat
|
||||
|
||||
if imageWidth > imageHeight {
|
||||
thumbnailWidth = min(imageWidth, 100)
|
||||
thumbnailWidth = min(imageWidth, YepConfig.MetaData.thumbnailMaxSize)
|
||||
thumbnailHeight = imageHeight * (thumbnailWidth / imageWidth)
|
||||
} else {
|
||||
thumbnailHeight = min(imageHeight, 100)
|
||||
thumbnailHeight = min(imageHeight, YepConfig.MetaData.thumbnailMaxSize)
|
||||
thumbnailWidth = imageWidth * (thumbnailHeight / imageHeight)
|
||||
}
|
||||
|
||||
let audioMetaDataInfo: [String: AnyObject]
|
||||
|
||||
if let thumbnail = image.resizeToSize(CGSize(width: thumbnailWidth, height: thumbnailWidth), withInterpolationQuality: kCGInterpolationLow) {
|
||||
let blurredThumbnail = thumbnail.blurredImageWithRadius(5, iterations: 10, tintColor: UIColor.clearColor())
|
||||
if let thumbnail = image.resizeToSize(CGSize(width: thumbnailWidth, height: thumbnailHeight), withInterpolationQuality: kCGInterpolationLow) {
|
||||
let blurredThumbnail = thumbnail.blurredImageWithRadius(5, iterations: 7, tintColor: UIColor.clearColor())
|
||||
|
||||
let data = UIImageJPEGRepresentation(blurredThumbnail, 0.7)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user