Skip to content

Commit

Permalink
code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmcl committed Jan 24, 2024
1 parent a26adfd commit fd14973
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/KukaiCoreSwift/Services/MediaProxyService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ public class MediaProxyService: NSObject {
- parameter fromCache: Which cahce to search for the image, or load it into if not found and needs to be downloaded
- parameter fallback: If an error occurs and an image can't be downloaded/loaded in, display this image instead
- parameter downSampleSize: Supply the dimensions you wish the image to be resized to fit
- parameter maxAnimatedImageSize: set a size limit for animated images (in bytes). If exceeded, will only load the first frame of the image
- parameter completion: returns when operation finished, if successful it will return the downloaded image's CGSize
*/
public static func load(url: URL?, to imageView: UIImageView, withCacheType cacheType: CacheType, fallback: UIImage, downSampleSize: CGSize? = nil, maxAnimatedImageSize: UInt? = nil, completion: ((CGSize?) -> Void)? = nil) {
Expand Down Expand Up @@ -375,8 +376,7 @@ public class MediaProxyService: NSObject {
imageView.image = fallback
}

if image?.sd_isAnimated == true, let maxMemory = maxAnimatedImageSize, (image?.sd_memoryCost ?? 0) > maxMemory/*, let animatedImageView = imageView as? SDAnimatedImageView*/ /*let aniamtedImage = SDAnimatedImage*/ {
//animatedImageView.autoPlayAnimatedImage = false
if image?.sd_isAnimated == true, let maxMemory = maxAnimatedImageSize, (image?.sd_memoryCost ?? 0) > maxMemory {
imageView.image = image?.images?.first
} else {
imageView.image = image
Expand Down

0 comments on commit fd14973

Please sign in to comment.