Novell LINUX ENTERPRISE DESKTOP 10 SP2 - DEPLOYMENT GUIDE 08-05-2008 Deployment Manual page 281

Table of Contents

Advertisement

It is sometimes necessary to work out the correct MIME type for a file. This is usually
done by examining the file's name or contents and looking up the correct MIME type
in a database. If you add a new application (that is, extend the database), you must make
sure that other applications can recognize the files associated with the application. For
example, you might want to add the following:
• image/png files should be edited using the Gimp.
• image/png files should be described in English as Portable Network Graphics files.
• Files whose names end in .png should have the type image/png.
You can use a graphical editor (such as MIME-Editor
.net/phpwiki/index.php/MIME-Editor] to edit the database, or you can do
it manually by creating a file called $XDG_DATA_HOME/mime/packages/
Override.xml in the format described below. For information on the XDG_ variables,
see the Base Directory Specification
Standards_2fbasedir_2dspec].
When your new application is installed, it should install a file with the application's
name in $XDG_DATA_DIRS/mime/packages. For example, running the
./configure && make install command with the Gimp will create /usr/
local/share/mime/packages/gimp.xml.
This file has the following format:
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="image/png">
<comment xml:lang="en">PNG image</comment>
<comment xml:lang="af">png bleed</comment>
...
<magic priority="50">
<match type="string" value="\x89PNG" offset="0"/>
</magic>
<glob pattern="*.png"/>
</mime-type>
</mime-info>
This provides a comment in two languages, a rule to recognize PNG files by their
contents, and a rule to recognize PNG files by their names. You can provide information
about several types in the single application.xml file. You do not need to provide
any information which is also in the base package.
[http://rox.sourceforge
[http://freedesktop.org/wiki/
GNOME Configuration for Administrators
265

Advertisement

Table of Contents
loading

This manual is also suitable for:

Linux enterprise desktop 10 sp2

Table of Contents