Skip to content

Drivers & formats

Glide runs on GD or Imagick:

IMAGEPRESET_DRIVER=imagick

The value is read as env('IMAGEPRESET_DRIVER', env('IMAGE_DRIVER', 'gd')): when IMAGEPRESET_DRIVER is not set, the project-wide IMAGE_DRIVER is used (the variable spatie/laravel-medialibrary and other packages read), then gd.

The driver must be installed: ext-gd or ext-imagick.

fmGDImagickNotes
webpyesyesDefault format
jpgyesyes
pjpgyesyesProgressive JPEG, stored as .jpg
pngyesyesq has no effect
gifyesyesq has no effect
avifif GD is built with AVIF supportif ImageMagick has an AVIF delegateNot in the default allowed_formats

Only formats listed in allowed_formats (default webp, jpg, png, gif) can be requested. To serve AVIF, add it and check that the driver can encode it:

'allowed_formats' => ['webp', 'avif', 'jpg', 'png', 'gif'],

Responses get the matching Content-Type for webp, avif, jpg, png, gif and svg. Any other format Glide can produce (tiff, heic) is served as application/octet-stream — don’t add those to allowed_formats.

Whatever the driver can decode: JPEG, PNG, GIF, WebP with GD; with Imagick also AVIF, TIFF, and HEIC/HEIF (ImageMagick built with libheif). Phone photos in HEIC therefore need Imagick.

SVG input is handled separately, see SVG.

Terminal window
php -r 'print_r(gd_info());'
php -r 'print_r(Imagick::queryFormats("AVIF")); print_r(Imagick::queryFormats("HEIC"));'

A format the driver can’t encode or decode doesn’t raise an error to the client: the request returns 404. With APP_DEBUG=true the reason is logged as [Imagepresets] makeImage failed.