?
Duplicate of # 16795
avatar wenmengyu
wenmengyu
27 Jun 2017

Steps to reproduce the issue

Field media type does not support svg, media component configuration to increase the picture legal type

Expected result

Show svg type files

Actual result

Did not find svg type files

System information (as much as possible)

Additional comments

Hope to be able to dynamically modify the corresponding type of picture according to the media component configuration information

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;
	       }
avatar wenmengyu wenmengyu - open - 27 Jun 2017
avatar joomla-cms-bot joomla-cms-bot - change - 27 Jun 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 27 Jun 2017
avatar wenmengyu wenmengyu - change - 27 Jun 2017
The description was changed
avatar wenmengyu wenmengyu - edited - 27 Jun 2017
avatar wenmengyu wenmengyu - change - 27 Jun 2017
The description was changed
avatar wenmengyu wenmengyu - edited - 27 Jun 2017
avatar wenmengyu wenmengyu - change - 27 Jun 2017
The description was changed
avatar wenmengyu wenmengyu - edited - 27 Jun 2017
avatar wenmengyu wenmengyu - change - 27 Jun 2017
The description was changed
avatar wenmengyu wenmengyu - edited - 27 Jun 2017
avatar wenmengyu wenmengyu - change - 27 Jun 2017
The description was changed
avatar wenmengyu wenmengyu - edited - 27 Jun 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 27 Jun 2017
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
avatar joomla-cms-bot joomla-cms-bot - close - 27 Jun 2017
avatar joomla-cms-bot
joomla-cms-bot - comment - 27 Jun 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 27 Jun 2017

closed as duplicate Report of #16795

@wenmengyu please create a PR for the Solution of list.php


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16877.

Add a Comment

Login with GitHub to post a comment