Remove quality assurance checks from avatar image in timeline
This commit is contained in:
parent
c7f02150f9
commit
da7dcc2405
|
@ -13,7 +13,6 @@ import Articles
|
|||
|
||||
class MasterTimelineViewController: ProgressTableViewController, UndoableCommandRunner {
|
||||
|
||||
private static var minAvatarDimension: CGFloat = 20.0
|
||||
private var numberOfTextLines = 0
|
||||
|
||||
@IBOutlet weak var markAllAsReadButton: UIBarButtonItem!
|
||||
|
@ -393,7 +392,7 @@ private extension MasterTimelineViewController {
|
|||
|
||||
if let authors = article.authors {
|
||||
for author in authors {
|
||||
if let image = avatarForAuthor(author), imagePassesQualityAssurance(image) {
|
||||
if let image = avatarForAuthor(author) {
|
||||
return image
|
||||
}
|
||||
}
|
||||
|
@ -404,28 +403,18 @@ private extension MasterTimelineViewController {
|
|||
}
|
||||
|
||||
let feedIconImage = appDelegate.feedIconDownloader.icon(for: feed)
|
||||
if imagePassesQualityAssurance(feedIconImage) {
|
||||
if feedIconImage != nil {
|
||||
return feedIconImage
|
||||
}
|
||||
|
||||
if let feed = article.feed, let faviconImage = appDelegate.faviconDownloader.favicon(for: feed) {
|
||||
if imagePassesQualityAssurance(faviconImage) {
|
||||
return faviconImage
|
||||
}
|
||||
return faviconImage
|
||||
}
|
||||
|
||||
return FaviconGenerator.favicon(feed)
|
||||
|
||||
}
|
||||
|
||||
func imagePassesQualityAssurance(_ image: UIImage?) -> Bool {
|
||||
let minDimension = MasterTimelineViewController.minAvatarDimension * RSScreen.mainScreenScale
|
||||
if let image = image, image.size.height >= minDimension, image.size.width >= minDimension {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func avatarForAuthor(_ author: Author) -> UIImage? {
|
||||
return appDelegate.authorAvatarDownloader.image(for: author)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue