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.
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>
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.
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
There are both advantages and disavdantages of having the pictogram system we have chosen. Some of them will be discussed here.