Issue with .heic images

48 views
Skip to first unread message

Trond Helge Rolland

unread,
Oct 13, 2025, 7:26:04 AMOct 13
to ResourceSpace
It seems ResourceSpace is having problems creating thumbnails and other resized versions of .heic images (the iPhone image format). 

After some digging I suspect it's due to the identify function in the ImageMagick library that gives a blank response when asked for dimensions, and since these parameters are used further on to create the new image sizes the process fails. 

This is on Ubuntu 22.04 lts, so we probably should upgrade to 24.04 lts, but according to the installed ImageMagick it has heic support so should be able to handle the files without any issue (exiftool extracts the metadata easily, so the blank image has information about make and model of the phone as well as latitude/longitude).

ImageMagick version output: 
Version: ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP(4.5)
Delegates (built-in): bzlib djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib

Any suggestions on how to fix this, I'm tempted to try compiling a new version of ImageMagick (preferably v7) so see if that solves the issue, it seems 6.9 is still the default in 24.04 lts so it's not even guaranteed a do-release-upgrade will solve this. 

Regards, 
Trond Helge

Trond Helge Rolland

unread,
Oct 14, 2025, 5:46:27 AMOct 14
to ResourceSpace
A small update that might assist other users who have similar issues, it appears that it's not heic files, but heic version / iPhone images. 

I have two heic images, the one taken with an iPhone 14 works perfectly fine, while the one taken with a iPhone 15 goes blank because identify from ImageMagick can't fetch the image size. 
ExifTool extracts metadate on both without any issue, but the quicktime.metaimagesize tag is noticably different, on the iPhone 14 photo it's just 4032x3024, while for the iPhone 15 it's the resolution and then a bunch of other numbers (which probably informs you about the colorspace etc). 

So the issue is probably related to newer/updated version of the heic metadata ImageMagick doesn't handle well (at least the version I have installed). 

Jeff Nova

unread,
Oct 14, 2025, 9:48:37 AMOct 14
to resour...@googlegroups.com, ResourceSpace
Have you tried a custom ExifTool config with the -BigImage switch? It would recurse through previews. 


What happens when you do exiftool -a -U filename.ext ? Is there a different binary preview file in one that’s different from the other?

On Oct 14, 2025, at 5:46 AM, Trond Helge Rolland <trond...@gmail.com> wrote:

A small update that might assist other users who have similar issues, it appears that it's not heic files, but heic version / iPhone images. 
--
ResourceSpace: Open Source Digital Asset Management
http://www.resourcespace.com
---
You received this message because you are subscribed to the Google Groups "ResourceSpace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to resourcespac...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/resourcespace/ce4b35b5-dcc7-434d-9be8-0d719bdc4b01n%40googlegroups.com.

Trond Helge Rolland

unread,
Oct 15, 2025, 3:47:46 AMOct 15
to ResourceSpace
ExifTool is not the issue here, ExifTool can read the metadata fine, it's the identify (/usr/bin/identify) command from the ImageMagick library which ResourceSpace uses to get the initial size of the image before making thumbnail and various other sizes (preview, screen etc). According to the debug log (and confirmed by testing), the CLI output of the identify function for newer .heic images (which contain the hdr gain map, aka tmap) is blank, so the process to create all the different image sizes does not happen so we end up with a blank icon and no other sizes in ResourceSpace (you can download the original heic file without any problem which opens in other programs). 

I've also set up a blank test environment with Ubuntu 24.05 LTS with the newest available ImageMagick library (from apt) which has the same problem. I guess I'll have to send this in as a bug as I can't seem to find any workaround which doesn't involve changing the source code. 

Jeff Nova

unread,
Oct 15, 2025, 5:56:37 AMOct 15
to resour...@googlegroups.com, ResourceSpace
My suggestions were diagnostic in nature. But it sounds like you have a good plan! 

On Oct 15, 2025, at 3:47 AM, Trond Helge Rolland <trond...@gmail.com> wrote:

ExifTool is not the issue here, ExifTool can read the metadata fine, it's the identify (/usr/bin/identify) command from the ImageMagick library which ResourceSpace uses to get the initial size of the image before making thumbnail and various other sizes (preview, screen etc). According to the debug log (and confirmed by testing), the CLI output of the identify function for newer .heic images (which contain the hdr gain map, aka tmap) is blank, so the process to create all the different image sizes does not happen so we end up with a blank icon and no other sizes in ResourceSpace (you can download the original heic file without any problem which opens in other programs). 

Trond Helge Rolland

unread,
Oct 15, 2025, 9:27:25 AMOct 15
to ResourceSpace
Apologies, I misunderstood what you meant. You're very right, there is some extra data in exiftool that differs from older .heic images, so exiftool can handle it slightly better than ImageMagick (with the versions I have on hand at least)

From an iPhone 14 with iOS 17:
Compatible Brands                mif1, MiHE, MiPr, miaf, MiHB, heic
Handler Type                      Picture
Primary Item Reference            49
Meta Image Size                  4032x3024

iPhone 15 with iOS 18:
Compatible Brands                mif1, MiHB, MiHE, MiPr, miaf, heic, tmap
Handler Type                      Picture
Primary Item Reference            46
Unknown grpl                      (Binary data 28 bytes, use -b option to extract)
Meta Image Size                  5712x4284 0 516 2856 2142 0 0 64 0 0 15 16960 27 4675 15 16960 65521 24544 15 16960 27 4675 15 16960 18 29336 15 16960 0 10 15 16960 0 10 15 16960




Jeff Nova

unread,
Oct 15, 2025, 9:30:47 AMOct 15
to resour...@googlegroups.com, ResourceSpace
Can you please provide the files or the output again, including a -G0:1 switch?  I can liaise with the ImageMagick team and share my findings and try to help. 

On Oct 15, 2025, at 9:27 AM, Trond Helge Rolland <trond...@gmail.com> wrote:

Apologies, I misunderstood what you meant. You're very right, there is some extra data in exiftool that differs from older .heic images, so exiftool can handle it slightly better than ImageMagick (with the versions I have on hand at least)

Trond Helge Rolland

unread,
Oct 16, 2025, 6:52:44 AMOct 16
to ResourceSpace
I just did a test on my test server, if I upgrade ImageMagick (using the imei script from github.com/SoftCreatR/imei ) I get a fully functional ImageMagick version 7.1.2-7, which handles the newer .heic files without any problem. 

So that's my current solution I think, manually upgrade ImageMagick or wait until the new version is available in the offical repositories. 

-
TH

Reply all
Reply to author
Forward
0 new messages