I have users that need to upload images and notice in my error logs many are using the iPhone HEIC/HEIF image format.
Error received:
Intervention\Image\Exception\NotReadableException | PHP 8.1.11
Unsupported image type image/heif. GD driver is only able to decode JPG, PNG, GIF, BMP or WebP files.
I have read to use Imagemagick for this type of support. But I see on Mar. 6th 2021 the LibGD added AVIF & HEIF support.
I updated to PHP 8.1.11 and checked the GD version.
Looks like I'm still at version 2.1.0, which is a 2015 version. Maybe I'm incorrect here. It does say, "AVIF Support => enabled". Though it does not say "HEIF Support => enabled"
PHP Info:
gd
GD Support => enabled
GD Version => bundled (2.1.0 compatible)
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.9.1
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 8
PNG Support => enabled
libPNG Version => 1.6.34
WBMP Support => enabled
XPM Support => enabled
libXpm Version => 30512
XBM Support => enabled
WebP Support => enabled
BMP Support => enabled
AVIF Support => enabled
TGA Read Support => enabled
Questions:
- What are you all using to to support this format?
- I'd rather stick with GD since it's already installed, but if I do need to update the version from 2.1.0 to 2.3.+ How can I do this?
- If I am using the correct GD version, how can I get HEIF enabled?
Details:
- OS: Win 11
- Local Server: Laragon 6 Apache
- PHP 8.1.11
- Laravel 9+
- Livewire: Using this to upload images. Added
'avif ', 'heif', 'heic', 'heif-sequence', 'heic-sequence', to the 'temporary_file_upload' => 'preview_mimes' in the config/livewire.php file.