You are here

function svg_image_is_svg in Svg Image 7

Determine if a file URI is an SVG image based on its file extension.

Parameters

string $uri: A path or URI to an image.

Return value

bool TRUE if the image is an SVG. FALSE if it is not.

5 calls to svg_image_is_svg()
svg_image_field_attach_presave in ./svg_image.module
Implements hook_field_attach_presave().
svg_image_field_formatter_view in includes/svg_image.field.inc
Implements hook_field_formatter_view().
svg_image_file_presave in ./svg_image.module
Implements hook_file_presave().
svg_image_get_dimensions in ./svg_image.module
Get an SVG image's defined dimensions.
svg_image_preprocess_image_style in ./svg_image.module
Preprocess function for theme_image_style().

File

./svg_image.module, line 172

Code

function svg_image_is_svg($uri) {
  $mimetype = file_get_mimetype($uri);
  return $mimetype === 'image/svg+xml';
}