Introduction
This page describes the Svnwiki extension for handling images.
Purpose
The image extension allows you to include images in a Subversion repository and will handle them more intelligently than it handles regular files. In particular, it does the following things for images on which it is enabled:
- Create an HTML page about the image, where it will display some metadata (such as its tags and information about the author).
- Create multiple renders of the image in different sizes, so it can be more easily included in articles in the wiki.
- Define an image SGML tag that you can use in wiki articles. Through this tag you can request a specific size for the image; the largest render smaller than or equal to the requested size will be automatically picked.
- Include a thumbnail of the image in a index file that has thumbnails for all images.
Current status
The image extension is not yet finished:
- It only supports a few formats right now (though adding new formats should be trivial, as long as NetPBM supports them).
- It does not yet generate the index file with the thumbnails.
Dependencies
The image extension depends on NetPBM to do its magic.
Supported formats
Currently the image extension only supports the PNG and JPEG image formats.
Usage
Adding an image to the repository
In order to use this extension you need to add an image to the repository. Note that files inside a Subversion repository handled by Svnwiki should *not* have an extension set (instead, they should have the svn:mime-type property):
svn add file
Now set the mime-type correctly:
svn ps svn:mime-type image/png file
Right now the only supported MIME types are image/png and image/jpeg.
Finally, enable the image extension in your file:
svn ps svnwiki:handler image file
Alternatively, you could simply set the image property in the containing directory (in which case you should only add images to that directory).
Commit your file and you should be done.
Including an image in an article
To include an image (added as described above in order for this extension to handle it) in an article, use the image tag, as follows:
<image src="FILE" size="SIZE" class="CLASS" caption="CAPTION"/>
The image will be shown inside a div with a caption describing it. It will be linked to the HTML page for the image (in which the user can, among other things, view the different sizes in which the image is provided).
All parameters except src are optional. They have the following semantics:
- FILE
- This is the path to the image file, relative to the article to which you are adding the image tag. You can use an absolute path as well (starting it with a /).
- SIZE
- The size for the largest coordinate in the image. If a render for this size is not available, the largest one such that its largest coordinate is smaller than the specified size will be used. The default value is 500.
- CLASS
- Use this if you want the div containing the image to have a specific class. The default value is image.
- CAPTION
- By default, a caption will be shown based on the title of the image file (see the svnwiki:title property). Use this option to override it.
Authors
This extension was created by Alejandro Forero Cuervo and Nelson Castillo.
Last update: 2007-07-14 (Rev 12254)