0

I have an image file in my app directory. This is not encoded with the iOS default encoder but our own encoders.

The format can be JPEG (EXIF) or TIFF. They have been checked for compliancy with standards so for this post, we can treat it as any image.

I want to get metadata of the image but don't want to decode it. I have been suggested:

    CGImageSourceRef imageSourceRef = CGImageSourceCreateWithData((__bridge_retained CFDataRef)(localImageData), nil);



    CFDictionaryRef cfMetadata = CGImageSourceCopyPropertiesAtIndex(imageSourceRef, 0, nil);

    NSDictionary *metaDataDic = [NSDictionary dictionaryWithDictionary:(__bridge_transfer NSDictionary *)(cfMetadata)];

What I want to know is 'does this decode the image?'

I know there is an incremental option which is used when transferring images to server. Is there a way to stop the decoding after it gets the EXIF info?

Juan Catalan
  • 2,299
  • 1
  • 17
  • 23
Shravya Boggarapu
  • 572
  • 1
  • 7
  • 23
  • Why do you care if it decodes or not ? Create a copy of it and do whatever you want to. CGImageSourceCreateWithData already creates a copy of the original image. – Sandeep Jun 05 '15 at 08:27
  • Because of performance constraints. I may need to get metadata from a thousand images – Shravya Boggarapu Jun 05 '15 at 09:14

0 Answers0