Field media type does not support svg, media component configuration to increase the picture legal type
Show svg type files
Did not find svg type files
administrator\components\com_media\models\list.php
$ext = strtolower(JFile::getExt($file));
$params = JComponentHelper::getParams('com_media');
$image_extensions = ['jpg','png','gif','xcf','odg','bmp','jpeg','ico'];
$image_extensions = array_merge ($image_extensions,explode(',',$params->get('image_extensions')));
// image
if (in_array($ext,$image_extensions)){
$info = @getimagesize($tmp->path);
$tmp->width = @$info[0];
$tmp->height = @$info[1];
$tmp->type = @$info[2];
$tmp->mime = @$info['mime'];
if (($info[0] > 60) || ($info[1] > 60))
{
$dimensions = MediaHelper::imageResize($info[0], $info[1], 60);
$tmp->width_60 = $dimensions[0];
$tmp->height_60 = $dimensions[1];
}
else
{
$tmp->width_60 = $tmp->width;
$tmp->height_60 = $tmp->height;
}
if (($info[0] > 16) || ($info[1] > 16))
{
$dimensions = MediaHelper::imageResize($info[0], $info[1], 16);
$tmp->width_16 = $dimensions[0];
$tmp->height_16 = $dimensions[1];
}
else
{
$tmp->width_16 = $tmp->width;
$tmp->height_16 = $tmp->height;
}
$images[] = $tmp;
}
switch ($ext)
{
// Video
case 'mp4':
$tmp->icon_32 = 'media/mime-icon-32/' . $ext . '.png';
$tmp->icon_16 = 'media/mime-icon-16/' . $ext . '.png';
$videos[] = $tmp;
break;
// Non-image document
default:
$tmp->icon_32 = 'media/mime-icon-32/' . $ext . '.png';
$tmp->icon_16 = 'media/mime-icon-16/' . $ext . '.png';
$docs[] = $tmp;
break;
}
Labels |
Added:
?
|
Status | New | ⇒ | Duplicate Report |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-06-27 03:53:36 |
Closed_By | ⇒ | franz-wohlkoenig | |
Rel_Number | 0 | ⇒ | 16795 |
Relation Type | ⇒ | Duplicate of |
closed as duplicate Report of #16795
@wenmengyu please create a PR for the Solution of list.php
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/16877