5

I already do a lot of search for that but I didn't get any proper solution.

extension UIImage {

func getExifData() -> CFDictionary? {
    var exifData: CFDictionary? = nil

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

i try with this code but i found this result.

{
    ColorModel = RGB;
    Depth = 8;
    Orientation = 1;
    PixelHeight = 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 missing lots of information.help me.

Thank In Advance

Partha
  • 402
  • 4
  • 15
Dixit Akabari
  • 2,419
  • 13
  • 26
  • 2
    How confident are you that this specific image contains EXIF data? I would try under a controlled image that you are guaranteed that has EXIF data. I ask because this is printing EXIF and the variables associated. Seems like that is all the EXIF data it may contain – impression7vx Aug 01 '19 at 18:23
  • https://stackoverflow.com/questions/40175160/exif-data-read-and-write – Taimoor Suleman Aug 02 '19 at 11:36
  • @TaimoorSuleman i already tired with this code please check both code almost similar. – Dixit Akabari Aug 02 '19 at 11:38

0 Answers0