dmytro-anokhin / url-image

AsyncImage before iOS 15. Lightweight, pure SwiftUI Image view, that displays an image downloaded from URL, with auxiliary views and local cache.
MIT License
1.11k stars 96 forks source link

Image not displayed with resize processor on iOS 14.2 #85

Closed lisindima closed 4 years ago

lisindima commented 4 years ago

Summary and/or background Running on an iOS 14 device changed the expected behavior of the package. If a resize processor is used, the image will not be displayed correctly. The problem disappears if you don't use it

OS and what device you are using

Version of URLImage library

What you expected would happen Image display successfully

What actually happens A black placeholder is displayed after the image is loaded

Sample code

var scale: CGFloat {
        #if os(watchOS)
        return WKInterfaceDevice.current().screenScale
        #else
        return UIScreen.main.scale
        #endif
    }

    var size: CGFloat {
        #if os(watchOS)
        return 75.0
        #else
        return 100.0
        #endif
    }

    var body: some View {
        URLImage(
            path,
            delay: delay,
            processors: [Resize(size: CGSize(width: size, height: size), scale: scale)],
            placeholder: { _ in
                ProgressView()
            }
        ) {
            $0.image
                .resizable()
        }
        .cornerRadius(8)
        .frame(width: size, height: size)
    }

Test data https://rosenergo.calcn1.ru/storage/uploads%2F11.08.2020%2F440%2F440-XXX000-0.jpg

Additional information:

Simulator Screen Shot - iPhone 11 Pro - 2020-09-18 at 12 57 16

dmytro-anokhin commented 4 years ago

Hey, if you can - please don't use it for now. I need some time to investigate. Thank you for detailed report.

lisindima commented 4 years ago

on iOS 14.2 beta 2 the problem persists

dmytro-anokhin commented 4 years ago

Sorry, but I'm no longer supporting v0.9. I removed processing pipeline from v2.0 as it was quite complex. Maybe will reintroduce it later.