Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 380 Bytes

README.md

File metadata and controls

22 lines (16 loc) · 380 Bytes

DetectImageType

detect image type from image data

example

let namesArray = ["dogdog_png.png",
    "dogdog_jpg.jpg",
    "dogdog_bmp.bmp",
    "dogdog_webp.webp",
    "smell.gif", ]
    
for name in namesArray {
    if let data = dataWithName(name) {
    let type = Data.detectImageType(with: data)
    print("image name = \(name), type = \(type)")
    }
}