HEIC reader/picker

Hi all,

I’m wondering if there’s a way to read HEIC files (“Live photos”) from an iPhone, and display an image picker like the IOS or macOS Photos app does, to choose the frame you want.

This would be running in macOS; I don’t need this to run in iOS on the phone. I’ve tried using Mac Photos to import from the phone, then export the original image (which winds up exporting a JPEG and a MOV file containing the individual live frames.

However, it looks like the live frames in the MOV are subsampled. Opening in Graphic Converter, for example, I see that the original image is 3024 x 4032, whereas the individual movie frames are only 1080 x 1440. I don’t understand how Apple is getting the high res version of the image no matter what frame I choose in Photos.

Any thoughts on this? I can always just use the image picker in Photos and then save the chosen JPEG, but I was hoping to do it in Xojo.

Thanks, and happy holidays!

We could add the PH classes from Apple’s Photos framework to MBS Plugin to support this a bit.

I don’t have any live photos, but it sounds like Apple is splitting the HEIC file for you when you export. They do this for RAW image files, and it drives me nuts, especially as they crack down on my workarounds.

Once you have the original file (In Photos do a Get Info, copy the file name, then use Find Any File to find the actual damn file), you stand a better chance of doing something with it. My guess would be that the file is movie format, so if you open it via the Movie controls in Xojo, you should be able to play it.

Extracting a still from a movie is a little harder, but I can provide some code for this.

The biggest challenge that I can see, is providing a way for the user to select the original file from Photos. There is some code on my site for displaying an Apple Media selection palette (https://ohanaware.com/xojo/), which may allow the user to drag the HEIC file from Photos directly into your application, then again it may not.

Thanks for the offer @Christian Schmitz ,but this is for a personal project so I don’t have the funds to pay for this addition. If it someday shows up in MBS plugins, that would be great.

And @Sam Rowlands I did what you suggested re finding the original file, but the filename ends in JPG and the file is, in fact, a JPEG file even though it is definitely a “Live” photo (and can be edited as such in Photos). I’m not sure where the movie portion is stored; perhaps in Photos’ SQLite database?

hmmm… I don’t have any live photos so I’m a little unclear on this, I only have my experience with RAW images to compare with (Apple hates the idea that users may want to edit their RAW images in a different program).

My understanding is that HEVC is the movie format and HEIFF is the image file format, perhaps doing a search on your machine for .hevc files might reveal something.

I have some HEIF animations, but they don’t play in Apple’s Preview and Quicktime won’t open them. I also have a Quicktime Movie that’s been encoded with HEVC and that plays fine.

You may be out of luck from an OS support level here.