function responsive_image_get_mime_type
Same name and namespace in other branches
- 10 core/modules/responsive_image/responsive_image.module \responsive_image_get_mime_type()
- 9 core/modules/responsive_image/responsive_image.module \responsive_image_get_mime_type()
- 8.9.x core/modules/responsive_image/responsive_image.module \responsive_image_get_mime_type()
Determines the MIME type of an image.
Parameters
string $image_style_name: The image style that will be applied to the image.
string $extension: The original extension of the image (without the leading dot).
Return value
string|null The MIME type of the image after the image style is applied, or NULL if not found.
Deprecated
in drupal:11.3.0 and is removed from drupal:13.0.0. Use \Drupal\responsive_image\ResponsiveImageBuilder::getMimeType() instead.
See also
https://www.drupal.org/node/3548329
File
-
core/
modules/ responsive_image/ responsive_image.module, line 251
Code
function responsive_image_get_mime_type($image_style_name, $extension) {
@trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.3.0 and is removed from drupal:12.0.0. Use \\Drupal\\responsive_image\\ResponsiveImageBuilder::getMimeType() instead. See https://www.drupal.org/node/3548329', E_USER_DEPRECATED);
return \Drupal::service(ResponsiveImageBuilder::class)->getMimeType($image_style_name, $extension);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.