apply_filters( ‘getimagesize_mimes_to_exts’, array $mime_to_ext )

In this article

Filters the list mapping image mime types to their respective extensions.

Parameters

$mime_to_extarray
Array of image mime types and their matching extensions.

Source

$mime_to_ext = apply_filters(
	'getimagesize_mimes_to_exts',
	array(
		'image/jpeg' => 'jpg',
		'image/png'  => 'png',
		'image/gif'  => 'gif',
		'image/bmp'  => 'bmp',
		'image/tiff' => 'tif',
		'image/webp' => 'webp',
		'image/avif' => 'avif',

		/*
		 * In theory there are/should be file extensions that correspond to the
		 * mime types: .heif, .heics and .heifs. However it seems that HEIC images
		 * with any of the mime types commonly have a .heic file extension.
		 * Seems keeping the status quo here is best for compatibility.
		 */
		'image/heic' => 'heic',
		'image/heif' => 'heic',
		'image/heic-sequence' => 'heic',
		'image/heif-sequence' => 'heic',
	)
);

Changelog

VersionDescription
3.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.