TIP MimeIconPlugin is not installed on Foswiki.org.

MimeIconPlugin

Icon sets for mimetypes

This plugin tries to map known mime types commonly found on the internet to an icon set. There are not many icon sets that have a got coverage of mime types despite looking nicely, yet still coherent, not too exotic so that they can be used with a variety of web designs without too much of a problem.

MimeIconPlugin comes with two complete icon sets, namely oxygen and crystal provided in several sizes.

Usage

MimeIconPlugin implements a single macro %MIMEICON which returns the right icon in the desired size of an icon theme for a given file.

For instance you type:
%MIMEICON{
  "screenshot.png" 
  size="48" 
  theme="oxygen"
}%

will give you:

%MIMEICON{ "screenshot.png" size="48" theme="oxygen" }%

if this plugin is installed.

The idea is that you can pretty much throw any file at it and %MIMEICON will return the right icon for it reflecting the mimetype of this file. Well, obviously there is a fallback to a neutral icon in case some file extension is totally unknown.

REST service

The get endpoint allows to retrieve a proper icon for a given mime type or file.

Parameter Description Default
file file or file extension for which to retrieve a matching icon  
size size of icon 48
theme icon set $Foswiki::cfg{Plugins}{MimeIconPlugin}{Theme}

Calling the get service will create a redirect to the proper icon url in a way that it can be used in an IMG html tag

<img src="%SCRIPTURLPATH{"rest"}%/MimeIconPlugin/get?file=foobar.docx;size=48" />

redirects to

.../pub/System/MimeIconPlugin/oxygen/48x48/application-vnd.oasis.opendocument.text.png

Examples

Oxygen

MimeIconPluginSnap2.png

Crystal

MimeIconPluginSnap1.png

Installation Instructions

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. "Extensions Operation and Maintenance" Tab -> "Install, Update or Remove extensions" Tab. Click the "Search for Extensions" button. Enter part of the extension name or description and press search. Select the desired extension(s) and click install. If an extension is already installed, it will not show up in the search results.

You can also install from the shell by running the extension installer as the web server user: (Be sure to run as the webserver user, not as root!)
cd /path/to/foswiki
perl tools/extension_installer <NameOfExtension> install

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See https://foswiki.org/Support/ManuallyInstallingExtensions for more help.

Dependencies

None

Change History

30 Aug 2017: (2.00) added get REST handler
09 Sep 2016: (1.31) added vsd to image mapping
17 Jul 2015: (1.30) added support for google file formats webp, weba, webm
22 May 2013: (1.20) only ship icons covered by a mapping
16 Dec 2011: (1.10) fixed mapping in oxygen icon set; fix to make sure the icon mapping is read in properly

Topic attachments
I Attachment Action Size Date Who Comment
MimeIconPlugin.md5md5 MimeIconPlugin.md5 manage 165 bytes 30 Aug 2017 - 13:58 MichaelDaum  
MimeIconPlugin.sha1sha1 MimeIconPlugin.sha1 manage 189 bytes 30 Aug 2017 - 13:58 MichaelDaum  
MimeIconPlugin.tgztgz MimeIconPlugin.tgz manage 6 MB 30 Aug 2017 - 13:58 MichaelDaum  
MimeIconPlugin.zipzip MimeIconPlugin.zip manage 8 MB 30 Aug 2017 - 13:57 MichaelDaum  
MimeIconPluginSnap1.pngpng MimeIconPluginSnap1.png manage 18 K 30 Aug 2017 - 13:57 MichaelDaum  
MimeIconPluginSnap2.pngpng MimeIconPluginSnap2.png manage 40 K 30 Aug 2017 - 13:57 MichaelDaum  
MimeIconPlugin_installerEXT MimeIconPlugin_installer manage 164 K 30 Aug 2017 - 13:58 MichaelDaum  
Topic revision: r11 - 30 Aug 2017, MichaelDaum - This page was cached on 15 Feb 2018 - 18:33.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License