I did what was suggested here reducing the image and also compressing but doesn’t work on iOS 16 (iPhone 12 and iPad Air 4). Any other ideas ? Below the code used:
extension WidgetContent {
var image: Image? {
guard let picData = self.pic, let uiImage = UIImage(data: picData) else {
return nil
}
let targetWidth = uiImage.size.width
let targetSize = CGSize(width: targetWidth, height: uiImage.size.height * targetWidth / uiImage.size.width)
guard let resizedImage = uiImage.resized(toSize: targetSize) else {
return nil
}
var compressionQuality: CGFloat = 0.7
var imageData = resizedImage.jpegData(compressionQuality: compressionQuality)
while imageData?.count ?? 0 > 100 * 1024, compressionQuality > 0.1 {
compressionQuality -= 0.1
imageData = resizedImage.jpegData(compressionQuality: compressionQuality)
}
guard let compressedImage = UIImage(data: imageData ?? Data()) else {
return nil
}
return Image(uiImage: compressedImage)
}
}
Post
Replies
Boosts
Views
Activity
Just complementing, issue continues on iPhone X but my Apple Watch associated with this iPhone X updated successfully also iPhone 7 updated seamlessly.