public function getFileExtension()
{
$mapping = ["image/png" => "png", "image/jpeg" => "jpg", "image/gif" => "gif", "image/tiff" => "tif", "image/svg+xml" => "svg"];
$mimeType = $this->getMimeType();
if (isset($mapping[$mimeType])) {
return $mapping[$mimeType];
}
if ($this->getAsset()) {
return \Pimcore\File::getFileExtension($this->getAsset()->getFilename());
}
return "";
}