INNER CODE UNIT · Swift
handleAPNG
duguyihou/react-native-turbo-image · ios/TurboImageView.swift:291
func handleAPNG() {
struct Static {
static var didRegister = false
}
if !Static.didRegister {
ImageDecoderRegistry.shared.register { context in
// Signature bytes for the acTL chunk in an APNG file
let acTLSignature = Data([0x61, 0x63, 0x54, 0x4C])
// Search for the acTL chunk signature in the data
if let _ = context.data.range(of: acTLSignature) {
return ImageDecoders.Empty()
} else {
return nil
}
}
Static.didRegister = true
}