diff --git a/Yep/Configs/YepConfig.swift b/Yep/Configs/YepConfig.swift index b7146ff8..e6bc3b33 100644 --- a/Yep/Configs/YepConfig.swift +++ b/Yep/Configs/YepConfig.swift @@ -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 } } diff --git a/Yep/ViewControllers/Conversation/ConversationViewController.swift b/Yep/ViewControllers/Conversation/ConversationViewController.swift index 88553e5a..03e8b363 100644 --- a/Yep/ViewControllers/Conversation/ConversationViewController.swift +++ b/Yep/ViewControllers/Conversation/ConversationViewController.swift @@ -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)