What is the method to obtain an image in JPEG format but it appears to be HEIF format in the system ?

What is the method to obtain an image in JPEG format but it appears to be HEIF format in the system?

Some of the users set the setting as followed: (Settings -> Camera -> Formats)

1. CAMERA CAPTURE: High Efficiency

2. TRANSFER TO MAC OR PC: Keep Originals


However, I wish both of my apps and web application could be compatible, so that I would need an API in order to get the image in JPEG format.

Is there any API available which can get the JPEG image(not HEIF data)?

I hope to obtain the JPEG data which is exactly the same as AirDrop or Image Capture (Mac app).


I've tried requestImageDataForAsset:options:resultHandler: to get the image data before, but the mentioned NSData's UTI is in public.heic format.

Therefore, I tried to convert it into JPEG format by using CIImage, but the written data's bytes is different from the "Image Capture" obtained image.


CIImage *inputImage = [CIImage imageWithData:imageData];
CIContext * context = [CIContext contextWithOptions: nil];
imageData = [context JPEGRepresentationOfImage:inputImage colorSpace:inputImage.colorSpace options:@{}];


Or is there any other solutions or ways to obtain the JPEG image exactly the same as in "AirDrop" or "Image Capture" documents?