Check if device is able to decode HEIC data

Hi!


Currently I can check if a device is able to encode HEIC with the following code:


func heicEncodingSupported() -> Bool {
  let supportedTypes = CGImageDestinationCopyTypeIdentifiers() as NSArray
  return supportedTypes.contains(AVFileType.heic)
}
//This return false on an iPhone SE.


But how can I check if a device is able to decode HEIC?

For example my iPhone SE is not able to encode HEIC but is able to decode it by loading HEIC data inside an UIImage object.


var heicImage = UIImage(data:heicData)
//This will correctly load the image on an iPhone SE.


Is it correct to say that all devices that support iOS11 are able to decode HEIC data?

Or there is a way to check if the device is really able to decode HEIC data?


Thank you

Answered by Claude31 in 408130022

Yes, that seems to be the right assumption.


https://support.apple.com/en-mz/HT207022


read this for more specific info on heic:

h ttps://blog.addpipe.com/heif-hevc-ios-11-quick-overview/

Because it stores HEVC data all iOS and macOS devices (upgraded to iOS 11 and macOs High Sierra) will be able to play/view the new .heic image files using software decode.

Accepted Answer

Yes, that seems to be the right assumption.


https://support.apple.com/en-mz/HT207022


read this for more specific info on heic:

h ttps://blog.addpipe.com/heif-hevc-ios-11-quick-overview/

Because it stores HEVC data all iOS and macOS devices (upgraded to iOS 11 and macOs High Sierra) will be able to play/view the new .heic image files using software decode.

Thank you Claude31!

Check if device is able to decode HEIC data
 
 
Q