question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iPhone HEIC images fail to load

See original GitHub issue

Hi Dirk,

Many thanks for providing the browser-based documentation. Thanks to it, I was finally able to start working on my project. The initial version of the documentation did not contain an example for working with user-provided images, so I added that functionality myself. Unfortunately, the page errors out when I try to load a HEIC photo I took with an iPhone.

Error log

That was maybe a month ago. When I went to check the documentation again this morning, I saw that you added the image upload functionality to the repo in the meantime, however it also fails to load iPhone HEIC photos (although it does not throw any error in the console like my code does, the image doesn’t get rendered).

Error

Is this a known limitation of magick-wasm? I was hoping that it would be able to work with HEIC photos thanks to libheif. I can load example.heic image from libheif without any issue, but other heic photos just won’t render with magick-wasm, even though they render fine on libheif’s online demo page.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
dlemstracommented, Oct 15, 2022

I already suspected this when I created this message but it turns out the for the heif library multi threading was enabled but this is not supported. I will need to make a change for this in the Magick.Native library but I was already able to seen the snowy picture that was posted by @jankais3r. This issue will be resolved in the next release.

0reactions
dlemstracommented, Oct 15, 2022

Managed to get a bit more info by creating a debug build. And I am getting the following output:

$std::__2::__throw_system_error(int, char const*)	@	1d69f4e6:0x2a87cad
$std::__2::thread::thread<void (std::__2::__async_assoc_state<heif::Error, std::__2::__async_func<heif::Error (heif::HeifContext::*)(unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>, int, int>>::*)(), std::__2::__async_assoc_state<heif::Error, std::__2::__async_func<heif::Error (heif::HeifContext::*)(unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>, int, int>>*, void>(void (std::__2::__async_assoc_state<heif::Error, std::__2::__async_func<heif::Error (heif::HeifContext::*)(unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>, int, int>>::*&&)(), std::__2::__async_assoc_state<heif::Error, std::__2::__async_func<heif::Error (heif::HeifContext::*)(unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>, int, int>>*&&)	@	1d69f4e6:0x1f42402
$std::__2::future<heif::Error> std::__2::__make_async_assoc_state<heif::Error, std::__2::__async_func<heif::Error (heif::HeifContext::*)(unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>, int, int>>(std::__2::__async_func<heif::Error (heif::HeifContext::*)(unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>, int, int>&&)	@	1d69f4e6:0x1f2418e
$std::__2::future<std::__2::__invoke_of<std::__2::decay<heif::Error (heif::HeifContext::*)(unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>, int, int) const>::type, std::__2::decay<heif::HeifContext const*>::type, std::__2::decay<unsigned int&>::type, std::__2::decay<std::__2::shared_ptr<heif::HeifPixelImage>&>::type, std::__2::decay<int&>::type, std::__2::decay<int&>::type>::type> std::__2::async<heif::Error (heif::HeifContext::*)(unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int&, std::__2::shared_ptr<heif::HeifPixelImage>&, int&, int&>(std::__2::launch, heif::Error (heif::HeifContext::*&&)(unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*&&, unsigned int&, std::__2::shared_ptr<heif::HeifPixelImage>&, int&, int&)	@	1d69f4e6:0x1f215dd
$heif::HeifContext::decode_full_grid_image(unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>&, std::__2::vector<unsigned char, std::__2::allocator<unsigned char>> const&) const	@	1d69f4e6:0x1f1d6a3
$heif::HeifContext::decode_image_planar(unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>&, heif_colorspace, heif_decoding_options const*) const	@	1d69f4e6:0x1f198de
$heif::HeifContext::decode_image_user(unsigned int, std::__2::shared_ptr<heif::HeifPixelImage>&, heif_colorspace, heif_chroma, heif_decoding_options const*) const	@	1d69f4e6:0x1f17a9c
$heif_decode_image	@	1d69f4e6:0x1ed0ea9
$ReadHEICImageHandle	@	1d69f4e6:0x775406
$ReadHEICImage	@	1d69f4e6:0x772ddb
$ReadImage	@	1d69f4e6:0xf70b9
$BlobToImage	@	1d69f4e6:0x777af
$MagickImage_ReadBlob
Read more comments on GitHub >

github_iconTop Results From Across the Web

Photos app problem with HEIC photos
Go to Settings/Camera/Formats. If you have "High Efficiency" selected, the iPhone will automatically save and upload the photos in HEIC format.
Read more >
iPhone HEIC Images Causing Image Uploading Issues
iPhone HEIC Images Causing Image Uploading Issues · 1. Open the image in Preview (Apple program) on desktop or laptop device. Click on...
Read more >
13 Ways to fix unable to load photo or video error on iPhone
To fix unable to load photo or video error on iPhone, 1. Check your iPhone storage, 2. Force quit and open Photos, 3....
Read more >
4 Practical Methods to Fix Can't Import HEIC Photos to Mac
Another way you can try to import your iPhone HEIC images to your Mac is to email the HEIC image to yourself from...
Read more >
Can't Open HEIC Files on Windows? Here's How to Fix It
1. Open HEIC on Windows Using CopyTrans · 2. Convert HEIC to JPEG Online · 3. Convert HEIC to JPEG Offline on Windows...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found