(if you don't like the colors, check out the alternate stylesheets or create your own:)

# Pictograms (pict://)

The pict: URL scheme is defined by the WAP working group. Pictograms is supposed to be a standardized set of images usable by web documents. The idea is that units with narrow bandwith will save network traffic when using the pre-installed local images instead of fetching them from an external server.

## How to use in a markup document

Opera recognize `pict:` URLs in two cases; the `localsrc` attribute on `img` tags in WML and in the `data` attribute of an `object` element in all HTML variants.

`<img src="somebigimage.bmp" localsrc="pict:///arrow/down" />` `<object data="pict:///arrow/down" />`

A good way to use it is to have an `object` element with a `pict:` and a fallback `object` with an image fetched from a server. In that way the user will use the pictogram if present and fetch from server if there is not matching pictogram installed.

`<object data="pict:///arrow/down"><object data="somebigimage.bmp" /></object>`

## Implementation

To enable this feature you need to enable the FEATURE_PICTOGRAM feature in your `features.h` file

When Opera encounters an `pict:` URL it will search for a matching local image. The pictogram must be stored on disk (or similar) as either a GIF-, PNG-, JPEG- or WBMP-image.

Opera will first search for a matching image in the users Opera home directory (like `~/.opera/` on UNIX) and then the install directory (like `C:\Program Files\Opera` on Windows). The pictograms must be placed in a folder called `pictograms` under either of those folders.

The matching will break down the pict: URL into server name and path. Opera will start matching the servername with a folder with the same name under the pictogram folder. For `pict://www.wapforum.org/arrow/down` Opera will start looking for a folder called `www.wapforum.org` under the `pictograms` folder.
As specified, if the server name is missing (`pict:///arrow/down`) `www.wapforum.org` is assumed.

If the server name is matched Opera will continue looking for a path matching the path given in the pict URL except for the last part. For the URL `pict:///some/long/path/to/image` Opera will look for a folder called `some/long/path/to` under the `pictograms/www.wapforum.org` folder.

If all the folders in the path have been found, Opera will look for an image matching the last part of the path in the URL pluss one of the extensions `gif`, `png`, `jpg` or `wbmp` in decreasing order of preference. In `pict:///arrow/down` Opera will start looking for down.gif in the folder `pictograms/www.wapforum.org/arrow`.

### Examples

`pict://www.opera.com/logo/opera` will be matched against the following files: `~/.opera/pictograms/www.opera.com/logo/opera.gif ~/.opera/pictograms/www.opera.com/logo/opera.png ~/.opera/pictograms/www.opera.com/logo/opera.jpg ~/.opera/pictograms/www.opera.com/logo/opera.wbmp /opera/pictograms/www.opera.com/logo/opera.gif /opera/pictograms/www.opera.com/logo/opera.png /opera/pictograms/www.opera.com/logo/opera.jpg /opera/pictograms/www.opera.com/logo/opera.wbmp` `pict:///arrow/down` will be matched against the following files: `~/.opera/pictograms/www.wapforum.org/arrow/down.gif ~/.opera/pictograms/www.wapforum.org/arrow/down.png ~/.opera/pictograms/www.wapforum.org/arrow/down.jpg ~/.opera/pictograms/www.wapforum.org/arrow/down.wbmp /opera/pictograms/www.wapforum.org/arrow/down.gif /opera/pictograms/www.wapforum.org/arrow/down.png /opera/pictograms/www.wapforum.org/arrow/down.jpg /opera/pictograms/www.wapforum.org/arrow/down.wbmp`

## Pros and cons

There are both advantages and disavdantages of having the pictogram system we have chosen. Some of them will be discussed here.

### Pros

Simple mapping
  The direct mapping from `pict:` URL paths to file system paths is a very simple way of mapping using the file system as a database.
Simple expansion
  It is easy to expand the set of pictograms both for the phone manufacturer, the network operator and the end-user simply by copying the new images directly to a folder under `pictograms/`.
Using regular loading
  The `pict:` URL is just converted to a regular `file:` URL that can be loaded just like regular files. So there is no extra code for loading pictograms.
Using regular rendering
  Since the pictograms are regular image files they can also be rendered by the regular image decoders and rendered by the regular painting code.

### Cons

Based on file system
  The device must have an accessible file system for this system to work
Uses disk space
  Unlike fetching the pictograms as a subset of a large bitmap we actually have to have a separate file for each pictogram. That uses a bit more space.

Author: Stig Halvorsen , 2005-11-17