HEIF/HEIC support is coming in PHP 8.5

85 views
Skip to first unread message

Adrian London

unread,
Oct 1, 2025, 7:42:17 AM10/1/25
to Gallery 3 Users
From what I've read, the "getimagesize" command will support HEIC files from PHP 8.5 onwards.  This is due for release around November.

Most iPhones take photos in HEIC now, although a simple setting will change this back to jpeg.  HEIC is much more modern and has a better compression algorithm, so I'd prefer to use it.

The getimagesize command is used heavily in Gallery3 for determining the file type before most processing involving photos.  It's also used by the "exif" module for extracting the metadata (IPTC in block APP13).  I title/describe all my photos prior to uploading, so find the exif module very useful.

At the moment, I export all my photos from my phone in jpeg format so that G3 can upload them. 

Another change is that HEIC files don't support IPTC but instead use  XMP for storing metadata.  I've managed to edit the "exif" module to read XMP so I'm ready for the future :). The only downside is that G3 can write IPTC tags but not XMP ones, although that could potentially be coded too.

I doubt many people care about HEIC and XMP support.  However, I do, hence this post!

-- 
Adrian


Gwyneth Llewelyn

unread,
Jan 2, 2026, 3:32:07 PMJan 2
to Gallery 3 Users
Hear, hear!

That's good news indeed. A small correction: iPhones have supported HEIC since iOS 11 in September 2017; it's now the default format. You can save them to JPEG if you really wish to do so.

It's actually amazing how long the 'standard' image web formats — GIF, JPEG, PNG — have been around. They're utterly outdated in all possible regards, except, well, for compatibility's sake. Even JPEG2000 — which was briefly used by cameras before RAW (and now HEIC/AVIF...) became 'universal' and is still used in medical imaging, as well as some oddities such as the virtual world Second Life — which was a step towards improving JPEG dramatically is considered 'deprecated' — it is, after all, a quarter of a century old. HEIC and AVIF are orders of magnitude better than JPEG (and even JPEG2000) in all possible regards. Even WebP is far better than JPEG — that's why Google used it — and if it weren't for being built into the Chromium browsers (the other engines quickly following up), and heavily promoted by Google since it was launched... that format is now considered 'obsolete' by Google itself! 😳

That said, I've been a long-time fan of Flickr — except that they have been adamant in sticking with GIF, JPEG & PNG and utterly refuse to use anything else. As a consequence, they have limited the file sizes, the number of images stored, as well as the picture dimensions, in order to keep their storage costs manageable. That is incredibly stupid. All they ought to do is to run Tinify on all their existing images, converting them to AVIF (Tinify can read HEIC but only save to AVIF — probably because of licensing issues), and they'd save, oh, perhaps 80–90% of disk space. It's amazing how efficient these new formats are. And it's amazing how a company like Flickr hasn't realised yet that they're shooting their own feet (with a machine gun). Even if they don't use the ultra-super-duper-compression technology by Tinify (it comes with a price tag, after all), they could certainly use ImageMagick, which does a very reasonable conversion-with-compression (if you're fond of tinkering a lot with ImageMagick, instead of going with the plain defaults, you can come very close to the compression levels achieved by Tinify — it just takes time, patience, lots of experimenting, and reading the encyclopedic manual of ImageMagick to explore the wide range of options and possibilities there).

As soon as Gallery3 supports any of the new formats, I'll be happily converting all the images in my Gallery — goodbye, old, space-eating images (and bandwidth-consuming!), hello new world, where everything is smaller and downloads faster!

Alas, it also means that Gallery3 must fully support PHP 8.5. Because of potentially outstanding compatibility issues, I'm still using version 3.1.5 under PHP 7.4. I really shouldn't do that (security issues, obsolete PHP version, etc., etc., not to mention that the new engine driving PHP 8.X is even better than the already souped-up version done for PHP 7.X).

On the other hand, the IPTC/XMP/EXIF issue might be a problem. I'm spoilt: I tend to have tools that extract 'whatever tags are present' and not worry too much if the file format X supports tagging Y. I think that, again, ImageMagick can come to the rescue in several cases, as it can convert metadata to some extent (I use that feature every now and then, but I'm not sure how much gets converted and how much gets lost in the process).

Of course, this would be one of those things worth a plugin... if anyone was still developing plugins for Gallery3... lol

Cheers, and thanks for the 'news' (three months later, that is!)

   — Gwyn

Adrian London

unread,
Jan 2, 2026, 3:41:54 PMJan 2
to Gallery 3 Users
PHP 8.5 is now released, but my hosting provider will no doubt take a few months before my shared host is upgraded.

I currently run G3 on PHP 8.3 without issue, so I don't expect major issues with the PHP upgrade.

As for IPTC/XMP - same as you; I can use either as I manipulate my photos' metadata using exiftool before importing.  However, I've added functionality to G3 which will read IPTC and XMP as required. 

-- 
Adrian


Adrian London

unread,
Jan 11, 2026, 12:55:35 PMJan 11
to Gallery 3 Users
On a cold day, and wanting to keep my brain working, I decided to do the following:

- Take a 12 year old Macbook with a smashed screen and find a use for it
- Install LAMP (Ubuntu v24, Apache2, MySQL, PHP 8.5)
- Copy over my database, G3 installation and photos from my hosting provider

I managed to get it all working, so not only do I have a safe, sandbox copy of gallery3 to play with, but I can now say it works fine on PHP 8.5.

However, getting it to read HEIC files is going to take some time due to all the places that mime types seem to be checked and hard-coded within G3.  It might not even be possible, but I'm ready for the fight!

-- 
Adrian

Adrian London

unread,
Jan 12, 2026, 6:58:39 AMJan 12
to Gallery 3 Users
Having my own PHP playground means I can test things.  And I believe that, despite the hype, PHP isn't yet supporting HEIC properly, as I get the same error/failure as below:


I'll post to this thread again once it works.  Assuming it ever does.

-- 
Adrian



J.R.

unread,
Jan 12, 2026, 3:58:21 PMJan 12
to gallery...@googlegroups.com
Adrian,

I'm grown so technically obsolete that I don't even know what HEIC means, or is... could you give me a clue as to what it is/does in relation to gallery 3?

-- J.R.
--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gallery-3-users/90b74872-fcd6-4ede-a690-285b8f89bee8n%40googlegroups.com.

Whiskerfish1

unread,
Jan 12, 2026, 8:31:54 PMJan 12
to gallery...@googlegroups.com
Per Google AI  

A HEIC file (High Efficiency Image Container) is a modern image format, primarily used by Apple devices (iPhones, iPads) as the default for saving photos, offering superior compression (smaller size) with similar or better quality than JPEG, supporting features like Live Photos and HDR, but can have compatibility issues on non-Apple systems, often requiring conversion to JPG for wider use. 

Steve 

Virus-free.www.avg.com

Adrian London

unread,
Jan 13, 2026, 12:48:28 PMJan 13
to Gallery 3 Users
Thanks Steve!  JR - basically what Steve posted.

My iPhone and Macbook have wanted to export my photos in HEIC format for ages, but instead I select jpeg in order to upload them into G3.

This is one of those things which probably isn't a big deal, but it gives me something to tinker with :)

The main takeaway so far is that G3 works perfectly well on PHP 8.5.  (I upgraded from 8.3.)
-- 
Adrian

J.R.

unread,
Jan 13, 2026, 5:05:50 PMJan 13
to gallery...@googlegroups.com
Steve and Adrian,

 Ah so... this is explaining what I am knowing nothing about this thing you call HEIC... I ran like the wind away from Apple (which were my first computers) when the ill-fated LISA came out and it became obvious they were going to go their own proprietary way to guarantee a captive customer base as a means to keep high pricing power in play.  I'm all about open source... even gave up on Windows after they dumped version 7. I wear those Linux Jeans now.

-- J.R.
--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages