HEIC: Compatibility with iOS 18 image files #2161

Closed
opened 2026-02-20 01:07:17 -05:00 by deekerman · 8 comments
Owner

Originally created by @graciousgrey on GitHub (Aug 2, 2024).

Originally assigned to: @lastzero on GitHub.

As an iPhone user, I want PhotoPrism to also support HEIC images taken with the latest iOS 18 beta so I can properly index and view them.

This particular issues seems be fixed with the latest version of libheif:

However, we need to test the latest version first, as the previous version caused image rotation issues with older iOS versions, which apparently did not set the orientation correctly (i.e. they rotated the image with video attributes and changed the orientation with Exif at the same time), causing these images to be displayed incorrectly with newer libheif versions.

Related Issues:

Some of these issues have image files attached that caused orientation issues and can therefore be used to test the latest version of the heif-convert command that comes with libheif. In addition, our sample archive contains may HEIC files you can use for testing.

Alternative Solutions:

  • One possibility would be to generate HEIC thumbnails with libvips instead of using the heif-convert tool to generate JPEGs from HEIC files first. However, this also requires intensive testing for compatibility with all iOS versions and will not work with Linux kernel < 3.17 and on 32-bit devices as libvips is not compatible.

Any help in testing the latest versions of libheif and/or libvips would be much appreciated!

For this purpose, our sample archive contains HEIC image files created with different iPhone and iOS versions:

We also provide libheif binary installation packages in different versions that include the heif-convert tool:

We are happy to answer your questions either here or by email if you need help with testing. Please note, however, that our team will be on vacation until August 19 and may not be able to respond during this time.

Originally created by @graciousgrey on GitHub (Aug 2, 2024). Originally assigned to: @lastzero on GitHub. **As an iPhone user, I want PhotoPrism to also support HEIC images taken with the latest iOS 18 beta so I can properly index and view them.** This particular issues seems be fixed with the latest version of `libheif`: - https://github.com/strukturag/libheif/issues/1190 However, we need to **test the latest version** first, as the previous version caused image rotation issues with older iOS versions, which apparently did not set the orientation correctly (i.e. they rotated the image with video attributes and changed the orientation with Exif at the same time), causing these images to be displayed incorrectly with newer libheif versions. **Related Issues:** - https://github.com/strukturag/libheif/issues/227#issuecomment-1554505667 - https://github.com/photoprism/photoprism/issues/1064 - https://github.com/photoprism/photoprism/issues/2343 - https://github.com/photoprism/photoprism/discussions/2717 *Some of these issues have image files attached that caused orientation issues and can therefore be used to test the latest version of the `heif-convert` command that comes with `libheif`. In addition, our [sample archive](https://dl.photoprism.app/samples/Brands/Apple/) contains may HEIC files you can use for testing.* **Alternative Solutions:** - One possibility would be to generate HEIC thumbnails with `libvips` instead of using the `heif-convert` tool to generate JPEGs from HEIC files first. However, this also requires intensive testing for compatibility with all iOS versions and will not work with Linux kernel < 3.17 and on 32-bit devices as `libvips` is not compatible. ## Any help in testing the latest versions of `libheif` and/or `libvips` would be much appreciated! For this purpose, **our sample archive contains HEIC image files** created with different iPhone and iOS versions: - https://dl.photoprism.app/samples/Brands/Apple/ We also provide `libheif` binary installation packages in different versions that include the `heif-convert` tool: - https://dl.photoprism.app/dist/libheif/ - https://dl.photoprism.app/dist/libheif/README.html *We are happy to answer your questions either here or by email if you need help with testing. Please note, however, that our team will be on vacation until August 19 and may not be able to respond during this time.*
deekerman 2026-02-20 01:07:17 -05:00
Author
Owner

@lastzero commented on GitHub (Aug 2, 2024):

I tested the latest libheif v1.18.1 and found that the generated JPEG images are now oriented incorrectly (images taken with iOS 18.0 seem to work, but have the same issue from what I can see):

iphone_15_pro heic (1)

In addition, the conversion command included in libheif v1.18.1 is called heif-dec, as opposed to heif-convert in libheif v1.17.1, which is likely to cause another series of problems for users who are not using our Docker images, but locally installed dependencies instead.

The original image along with a correctly oriented JPEG version generated with libheif v1.17.1 can be found on our public demo at https://demo.photoprism.app/library/private?view=cards&order=newest&q=meerkats:

fit_720

You can also find it on your public download server:

Since our team is on vacation until August 19, it would be super amazing if someone from our community could take another look at it to find out what the exact problem is, e.g. by contacting Apple and/or the libheif maintainer to get more information. Feel free to use our sample images for this! 🖼️

@lastzero commented on GitHub (Aug 2, 2024): I tested the latest **[libheif](https://github.com/strukturag/libheif) v1.18.1** and found that the generated JPEG images are **now oriented incorrectly** (images taken with iOS 18.0 seem to work, but have the same issue from what I can see): ![iphone_15_pro heic (1)](https://github.com/user-attachments/assets/34ed0508-2c1a-4c0e-bbe4-c6a7e8b76299) In addition, the conversion command included in `libheif` v1.18.1 is called `heif-dec`, as opposed to `heif-convert` in `libheif` v1.17.1, which is likely to cause another series of problems for users who are not using our Docker images, but locally installed dependencies instead. The **original image** along with a **correctly oriented** JPEG version generated with **[libheif](https://github.com/strukturag/libheif) v1.17.1** can be found on our public demo at <https://demo.photoprism.app/library/private?view=cards&order=newest&q=meerkats>: ![fit_720](https://github.com/user-attachments/assets/7e6c9fd7-44cc-47d4-914d-875e5d869e81) You can also find it on your public download server: - https://dl.photoprism.app/samples/Brands/Apple/Apple%20iPhone%2015%20Pro/iphone_15_pro.heic **Since our team is on vacation until August 19, it would be super amazing if someone from our community could take another look at it to find out what the exact problem is, e.g. by contacting Apple and/or the libheif maintainer to get more information. Feel free to use our [sample images](https://dl.photoprism.app/samples/Brands/Apple/) for this!** :framed_picture:
Author
Owner

@lastzero commented on GitHub (Aug 3, 2024):

Good news, everyone! 🎉

(a) The image orientation seems to be fixed with these changes, which simply set the Exif Orientation tag value to 1 after new JPEG files have been generated with heif-dec (libheif executable, which converts HEIC files to JPEG).

(b) Since older versions of the same command (previously named heif-convert) behave differently according to our tests, we also added the new config option PHOTOPRISM_HEIFCONVERT_ORIENTATION which allows you to change the behavior, e.g. in case you do not use our official Docker images or this changes again in a future release:

Environment CLI Flag Default Description
PHOTOPRISM_HEIFCONVERT_BIN --heifconvert-bin heif-dec libheif HEIC image conversion COMMAND
PHOTOPRISM_HEIFCONVERT_ORIENTATION --heifconvert-orientation reset Exif ORIENTATION of images generated with libheif (reset, keep)
@lastzero commented on GitHub (Aug 3, 2024): Good news, everyone! :tada: (a) The image orientation **seems to be fixed** with these changes, which simply set the Exif `Orientation` tag value to 1 after new JPEG files have been generated with `heif-dec` (`libheif` executable, which converts HEIC files to JPEG). (b) Since older versions of the same command (previously named `heif-convert`) behave differently according to our tests, we also added the new config option `PHOTOPRISM_HEIFCONVERT_ORIENTATION` which allows you to change the behavior, e.g. in case you do not use our official Docker images or this changes again in a future release: | Environment | CLI Flag | Default | Description | |------------------------------------------------------------------|---------------------------|------------------------------------------|-------------------------------------------------------------------| | PHOTOPRISM_HEIFCONVERT_BIN | --heifconvert-bin | heif-dec | libheif HEIC image conversion `COMMAND` | | PHOTOPRISM_HEIFCONVERT_ORIENTATION | --heifconvert-orientation | reset | Exif `ORIENTATION` of images generated with libheif (reset, keep) |
Author
Owner

@lastzero commented on GitHub (Aug 3, 2024):

Based on my tests, there is still one HEIC image with a wrong JPEG orientation:

However, since it's from an iPhone 7 and the camera software is displayed as "ProCam 10.5.8", I believe it's not a problem with libheif, but with the file itself.

An updated preview build is now available on Docker Hub, so you can test libheif v1.18.1 together with our latest changes and improvements:

@lastzero commented on GitHub (Aug 3, 2024): Based on my tests, there is still one HEIC image with a wrong JPEG orientation: - https://dl.photoprism.app/samples/Formats/Image/HEIC/iphone_7.heic However, since it's from an iPhone 7 and the camera software is displayed as "ProCam 10.5.8", I believe it's not a problem with `libheif`, but with the file itself. An updated preview build is now available on [Docker Hub](https://hub.docker.com/r/photoprism/photoprism/tags), so you can test [`libheif` v1.18.1](https://dl.photoprism.app/dist/libheif/) together with our latest changes and improvements: - https://docs.photoprism.app/getting-started/updates/#development-preview
Author
Owner

@graciousgrey commented on GitHub (Aug 20, 2024):

Looks good to me 👍

@graciousgrey commented on GitHub (Aug 20, 2024): Looks good to me :+1:
Author
Owner

@mat1990dj commented on GitHub (Aug 26, 2024):

Hi all, after spending a couple of hours trying to figure out why my iPhone's 15PM pictures were not displayed in photoprism, by my wife's exact same phone, were displaying correctly I thought about it being iOS 18 (I have the beta) and bingo, here's the right issue.
Pictures are uploaded via webdav with photosync and moved to originals by photoprism but jpegs are not created even though the log says:
photoprism-photoprism-1 | time="2024-08-26T17:45:16Z" level=info msg="convert: converting 20240825_183512_401ADC2B.heic to 20240825_183512_401ADC2B.heic.jpg (heif-convert)"
I've read the thread but unsure how to help and continue, I've got MANY example pictures to use.
Is there a build that fixes this?

@mat1990dj commented on GitHub (Aug 26, 2024): Hi all, after spending a couple of hours trying to figure out why my iPhone's 15PM pictures were not displayed in photoprism, by my wife's exact same phone, were displaying correctly I thought about it being iOS 18 (I have the beta) and bingo, here's the right issue. Pictures are uploaded via webdav with photosync and moved to originals by photoprism but jpegs are not created even though the log says: `photoprism-photoprism-1 | time="2024-08-26T17:45:16Z" level=info msg="convert: converting 20240825_183512_401ADC2B.heic to 20240825_183512_401ADC2B.heic.jpg (heif-convert)"` I've read the thread but unsure how to help and continue, I've got MANY example pictures to use. Is there a build that fixes this?
Author
Owner

@lastzero commented on GitHub (Aug 26, 2024):

As mentioned above, an updated preview build is available for you to test this:
https://docs.photoprism.app/getting-started/updates/#development-preview

@lastzero commented on GitHub (Aug 26, 2024): As mentioned above, an updated preview build is available for you to test this: https://docs.photoprism.app/getting-started/updates/#development-preview
Author
Owner

@mat1990dj commented on GitHub (Aug 26, 2024):

Aaaghhh totally missed that, sometimes github compresses the thread and hides replies.
Shall I reindex the folder I know that contains the heif images (since I joined beta basically) ?

Edit: It's generating sidecars!

@mat1990dj commented on GitHub (Aug 26, 2024): Aaaghhh totally missed that, sometimes github compresses the thread and hides replies. Shall I reindex the folder I know that contains the heif images (since I joined beta basically) ? Edit: It's generating sidecars!
Author
Owner

@Jmoati commented on GitHub (Sep 10, 2024):

Work fine after a new convert and index.
Thank you.

@Jmoati commented on GitHub (Sep 10, 2024): Work fine after a new `convert` and `index`. Thank you.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/photoprism#2161
No description provided.