Downsample OTG transfer thumbnails
This commit is contained in:
@ -470,6 +470,7 @@ extension WiredCameraTransferViewController: UICollectionViewDelegate {
|
||||
/// 有线传输照片宫格 Cell。
|
||||
private final class WiredTransferPhotoCell: UICollectionViewCell {
|
||||
static let reuseIdentifier = "WiredTransferPhotoCell"
|
||||
private static let previewImageSize = CGSize(width: 180, height: 180)
|
||||
|
||||
private let imageView = UIImageView()
|
||||
private let statusLabel = UILabel()
|
||||
@ -503,7 +504,16 @@ private final class WiredTransferPhotoCell: UICollectionViewCell {
|
||||
|
||||
func apply(item: TravelAlbumOTGPhotoItem, selectionMode: Bool, selected: Bool) {
|
||||
if let url = item.thumbnailURL {
|
||||
imageView.kf.setImage(with: url, placeholder: UIImage(systemName: "photo"))
|
||||
let processor = DownsamplingImageProcessor(size: Self.previewImageSize)
|
||||
imageView.kf.setImage(
|
||||
with: url,
|
||||
placeholder: UIImage(systemName: "photo"),
|
||||
options: [
|
||||
.processor(processor),
|
||||
.scaleFactor(UIScreen.main.scale),
|
||||
.backgroundDecode
|
||||
]
|
||||
)
|
||||
} else {
|
||||
imageView.image = UIImage(systemName: "photo")
|
||||
imageView.tintColor = AppColor.textTertiary
|
||||
|
||||
Reference in New Issue
Block a user