قالب وردپرس درنا توس
Home / IOS Development / ios – Get (read) Exif data from UIImage

ios – Get (read) Exif data from UIImage



I've already searched a lot for that, but I didn't get a proper solution.

  UIImage extension {

func getExifData () -> CFDictionary? {
was exifData: CFDictionary? = zero

if let data = self.jpegData (compressionQuality: 1.0) {
// if let data = self.pngData () {
data.withUnsafeBytes {(bytes: UnsafePointer ) -> Valid
if la cfData = CFDataCreate (kCFAllocatorDefault, bytes, data.count) {
la source = CGImageSourceCreateWithData (cfData, nil)
exifData = CGImageSourceCopyPropertiesAtIndex (source !, 0, null)
}
}
}
return exifData
}
}

I try this code, but I found this result.

  {
ColorModel = RGB;
Depth = 8;
Orientation = 1
; Pixel Height = 1500; PixelWidth = 1124; ProfileName = "Display P3"; "{Exif}" = { PixelXDimension = 1124; PixelYDimension = 1500; }; "{JFIF}" = { DensityUnit = 0; JFIFVersion = ( 1, 0 1 ); XDensity = 72; YDensity = 72; }; "{TIFF}" = { Orientation = 1; }; }

but I lack a lot of information. Help me.

Thank In Advance


Source link