Table of Contents

Screenshots Plugin

Description

Provides screenshots upload and viewing subsystem for Trac. Uploaded screenshots can be described with short name, longer description and custom tags (if TracTags plugin is installed) and assigned to any number of components and versions registered in Trac. Screenshot uploads can be listed in timeline and screenshots can be referenced or embedded in wiki pages. Plugin internally defines few interfaces for further extension.

The name is a little misleading as of course it is perfectly able to be used as a picture archive for the wiki pages.

Download and Source

Dependencies

You need to have ​PIL library installed to get plugin working. Plugin optionally depends on TracTags plugin for screenshot tagging support.

Installation

Install plugins egg and set variables in the [screenshots] section of your trac.ini configuration file according to your needs. Following list shows all of them with a description and their default values:

Option

Description

Default Value

additional_tags

what additional screenshot attributes will be inserted as tags

author,components,versions,name

default_components

default values for component filter

all

default_description

description attached to the screenshot if not explicitly specified in request

$description

default_filter_relation

how the filters should be related by default

or

default_format

format which will be returned if no format is specified in request (see formats below)

html

default_list_item

how the [[ScreenshotsList]] macro should be expanded by default

$id - $name - $description

default_order_directions

whether to start with the first or last item by default

asc

default_orders

if not specified otherwise, by which criteria should we order?

id

default_versions

default values for version filter

all

ext

list of allowed file extension which can be uploaded

jpg,png

formats

in which formats images can be downloaded

raw,html,jpg,png

mainnav_title

Caption in Tracs main navigation menu (empty = hide item)

Screenshots

metanav_title

Caption in Tracs meta navigation menu (empty = hide item)

path

location of directory where plugin should store uploaded and generated images

/var/lib/trac/screenshots

default_format and formats must be supported by your PIL library installation. There are two meta formats: raw denotes original format of uploaded image and html is image embedded in HTML page. ext can also include the zip extension, which is not included by default for security reasons. If a zip file containing multiple images is uploaded, all of the images applying to the other extensions specified by ext will be added with the same metadata entered for the zip file - and the zip file itself will be abandoned.

default_components and default_versions options sets default values for component and version filter.

Another possible value for additional_tags except of those listed as default is description.

If you run Trac in environment which needs to enable plugins explicitly put in trac.ini these lines:

ScreenshotMatrixView is currently the only one present component for actual screenshots display although there are internaly defined interfaces so any other component with different view can be introduced in the future.

Create directory you have specified with path config option and make sure it is accessible by Trac server. The next step is to upgrade your environment:

# trac-admin <path_to_environment> upgrade

Permissions

Screenshots plugin defines four permissions - each one in this list depends on the one mentioned before it, and adds its permissions upon that (with SCREENSHOTS_FILTER and SCREENSHOTS_ORDER being on the same level):

SCREENSHOTS_ADD

permission to upload screenshots

SCREENSHOTS_ADMIN

permission to upload, delete, view, filter and order screenshots

SCREENSHOTS_DELETE

permission to delete screenshots

SCREENSHOTS_FILTER

allows to modify component and version filter

SCREENSHOTS_ORDER

permits to change the order they are displayed in

SCREENSHOTS_VIEW

permits to browse screenshots and see screenshot uploads in timeline

If you use apache, please restart it, before setting permissions. You can add these permissions by typing following commands from commandline or you can use WebAdminPlugin to do it for you:

Macros

There is a macro [screenshot:<screenshot_id>] for screenshots referencing.

For screenshot embedding in wiki page use [[Screenshot(<screenshot_id>, [<attribute>=<value>, ...])]]. First mandatory argument is ID of the screenshot. Number or image attributes
can be specified next. This is a list of them: