• Version: 2.5

Icon Inspector

Icon Inspector

It is recommended for all contributors to check their local changes to the RRZE Icon Set with the Icon Inspector script for conformity with the RRZE Icon Set guidelines. This way the repository can easily be kept clean and tidy.

The following sections are a HTML-ized version of the README file that is included in the Icon Inspector script.


0. Quick Usage

The Icon Inspector is included within the RRZE-PP projects. If you want to use the Icon Inspector, you can download it fromGitHub.

After downloading the Icon Inspector adjust the settings in the config.php file to your needs.
The file is well commented and should (hopefully) be self-explanatory.

Always start the Icon Inspector via the included inspect.sh or the ginspect.sh (GTK version) script. This will redirect all error/debug output to the errors.log file for later evaluation.

After the script run has been completed you can open the errors.log file in your favorite text editor to see what problems were found, if there are any.

Up

1. Introduction

The Regional Computing Centre Erlangen (RRZE) provides and maintains an icon set especially created for IT topics. The set is free to use under the popular creative commons licence.

Out of this project, the need for a tablerized overview of all available icons in the set arose. The icon set is created by using Inkscape and its scalable SVG format. The metadata included in these SVG images can be easily maintained by the icon designers and provides an easy way to store additional information about a specific icon.

The Icon Inspector can extract this information directly from the base SVG files and can use it to create an extensive and clear compendium of all icons within the set (see http://rrze-pp.github.io/rrze-icon-set/tango/gallery.html).

Additionally it also checks the icon structure for errors like missing fixed size icons, misplaced files and so on.

Up

2. Requirements

The Icon Inspector is completely written in PHP. It was developed using Eclipse PDT. The target operating system to run the Icon Inspector is LINUX.

Requirements are

  • php-5.2.10 and
  • Inkscape (only if you need auto creation of missing fixed scale icons)

compiled with (at least) the

  • cli
  • simplexml and
  • pcre

flags.
If you want to give the GTK2 GUI version a shot you also need the

  • php-gtk2

extension.
Because php-gtk2 extension is still considered unstable in most distributions it might not be that easy to obtain. A good starting point is the PHP-GTK homepage or the PHP-GTK community page.
If you do not like to compile it yourself: The steps described here worked for me under Ubuntu Jaunty.

Note that these requirements were pulled out of my development environment and are neither verified nor aim to be complete.

To be clear: It may be that other PHP extensions are also needed and the script may also run with a different (lower) version of PHP. This has not been extensively tested!

Up

3. Features

3.1 Icon overview

In order to generate the icon overview table the Icon Inspector uses a very simple template system. Basically the templates are stored in the templates/ directory and the output is placed in the generated/ directory. All the assembling takes place in the rrze_icon_inspector.php file.

3.2 Conformity checks

Besides the overview the Icon Inspector also checks all gathered data against the RRZE Icon Set requirements and collects a list of deviations from these requirements within the errors.log file.

Some of the possible problems, currently beeing checked, are

  • if all required fixed scale icons are available
  • if there are fixed scale icons without a scalable SVG
  • if all SVGs have a 'title' and 'keywords' field set in their metadata
  • if the 'title' field "correlates" with the icon filename (see 3.6 for further info)
  • if all files are correctly placed within the folder structure

3.3 Auto-creation of fixed size icons

If you activate it in the config.php file and have Inkscape installed, the Icon Inspector can also auto-generate all missing fixed size icons for you. The target format will be PNG. The auto-generation action will be logged to the errors.log file as a note.

3.4 Multiple detail levels support

Usually icon creaters design their icons scaled to full screen and with much love for details. These details may disappear or even worse make the icon undecipherable for the user when scaled down. Especially with very small icon sizes, like 16x16, the need for a less detailed icon version grew, to ensure the icon's message can still be communicated to the user.

Therefore the Icon Inspector also supports multiple detail versions of the same icon. To use this feature just store the scalable SVG of each detail level within the fixed size directory of its intended minimum size instead of storing it in the scalable/ directory and the icon inspector will automatically recognize it. Additionally it is suggested to store a master/highest detail scalable in the scalables/ directory.

Here are some examples to clarify the above.

Single detail example:

tango/
   scalable/
      actions/
         action-undo.svg (<-- one scalable for all sizes)
      categories/
      ...
   16x16/
      actions/
         action-undo.png
      categories/
      ...
   32x32/
      actions/
         action-undo.png
      categories/
      ...
   ...

Multi detail example:

tango/
   scalable/
      actions/
         action-undo.svg (<-- master/highest detail scalable)
      categories/
      ...
   16x16/
      actions/
         action-undo.svg (<-- scalable for 16x16 and below)
         action-undo.png
      categories/
      ...
   32x32/
      actions/
         action-undo.svg (<-- scalable for 32x32 and below)
         action-undo.png
      categories/
      ...
   ...

3.5 Privacy protection

Inspired by Sebastian Pipping's svgstrip script (see also "Privacy concern with export-filename and sodipodi:absref") the Icon Inspector removes certain attributes from Inkscape's SVG files which contain some information about the local system which may be considered a privacy concern.

The attributes beeing removed are

  • sodipodi:absref from the svg tag
  • sodipodi:docname from the svg tag
  • sodipodi:docbase from the svg tag
  • inkscape:export-filename from all tags

3.6 Automatic metadata generation

As the first feature in the line of automatic metadata generation, the SVG's title element can now be automatically fixed. If activated in the config.php file the title element will be set to the SVG's filename without extension and all '_' and '-' replaced with whitespace.

Example: account-delete.svg will get the title set to "account delete"

Up

4. Notes

The Icon Inspector has only been real-world tested with SVG as the source scalable format and PNG as the target fixed-size format.

However it SHOULD work with others, too.

Currently the Icon Inspector recognises the following file extensions as pictures. Files with deviating extensions will be filtered and NOT be processed at all.

Recognised extensions:

  • png
  • gif
  • jpg
  • jpeg
  • tif
  • bmp
  • xcf
  • xcf.bz2
  • svg

Additionally files with the following extensions are considered 'scalables' and treated as such internally.

Recognised scalables:

  • svg
  • xcf
  • xcf.bz2

Hidden files and directories -- those prefixed with a dot '.' -- are also ignored.

For compatibility with popular revision control systems '.svn' and 'CVS' directories are ignored by default.

Up