Version 24 (modified by izzy, 10 years ago) (diff)

updated latest feature adds

Screenshots Plugin

Notice: This plugin is unmaintained and available for adoption.


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 embender in wiki pages. Plugin internally defines few interfaces for further extension.

Bugs/Feature Requests

Existing bugs and feature requests for ScreenshotsPlugin are here.

If you have any issues, create a new ticket but read BugReporting page first, please.

Download and Source

Download the [download:screenshotsplugin zipped source], check out using Subversion, or browse the source with Trac.


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


Install plugin's egg and set variables in trac.ini configuration file according to your needs. Following list shows all of them with their default values:

default_components = none
default_description = $description
default_filter_relation = or
default_format = html
default_format = html
default_list_item = $id - $name - $description
default_order_directions = asc
default_orders = id
default_versions = none
ext = jpg,png
formats = raw,html,jpg,png
mainnav_title = Screenshots
metanav_title =
path = /var/lib/trac/screenshots
default_components default values for component filter
default_description description attached to the screenshot if not explicitly specified in request
default_filter_relation how the filters should be related by default
default_format format which will be returned if no format is specified in request (see formats below)
default_list_item how the [[ScreenshotsList]] macro should be expanded by default
default_order_directions whether to start with the first or last item by default
default_orders if not specified otherwise, by which criteria should we order?
default_versions default values for version filter
ext list of allowed file extension which can be uploaded
formats in which formats images can be downloaded
mainnav_title Caption in Tracs main navigation menu (empty = hide item)
metanav_title Caption in Tracs meta navigation menu (empty = hide item)
path location of directory where plugin should store uploaded and generated images

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 embended in HTML page.

default_components and default_versions options sets default values for component and version filter. Set these variables according your Trac setup, otherwise, you would't see any screenshots with default filter.

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

TracScreenshots.init.ScreenshotsInit = enabled
TracScreenshots.core.ScreenshotsCore = enabled
TracScreenshots.api.ScreenshotsApi = enabled = enabled
TracScreenshots.timeline.ScreenshotsTimeline = enabled # For 0.11 branch.
TracScreenshots.tags.ScreenshotsTags = enabled

If you don't have TagsPlugin installed replace last line with

tracscreenshots.tags.screenshotstags = disabled

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


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_VIEWpermits to browse screenshots and see screenshot uploads in timeline
SCREENSHOTS_FILTERallows to modify component and version filter
SCREENSHOTS_ORDERpermits to change the order they are displayed in
SCREENSHOTS_ADMINpermission to upload/delete screenshots

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:

# trac-admin <path_to_environment> permission add <user> SCREENSHOTS_VIEW
# trac-admin <path_to_environment> permission add <user> SCREENSHOTS_FILTER
# trac-admin <path_to_environment> permission add <user> SCREENSHOTS_ORDER
# trac-admin <path_to_environment> permission add <user> SCREENSHOTS_ADMIN


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

For screenshot embending 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:

  • align - Specifies image alignment in wiki page. Possible values are: left, right and center.
  • alt - Alternative description of image.
  • border - Sets image border of specified width in pixels.
  • class - Class of image for CSS styling.
  • description - Brief description under the image. Accepts several variables (see bellow).
  • format - Format of returned image or screenshot behind link.
  • height - Height of image. Set to 0 if you want original image height.
  • id - ID of image for CSS styling.
  • longdesc - Detailed description of image.
  • title - Title of image.
  • usemap - Image map for clickable images.
  • width - Width of image. Set to 0 if you want original image width.

Attribute description displays several variables:

  • $id - ID of image.
  • $name - Name of image.
  • $author - User name who uploaded image.
  • $time - Time when image was uploaded.
  • $file - File name of image.
  • $description - Detailed description of image.
  • $width - Original width of image.
  • $height - Original height of image.
  • $tags - Comma separated list of screenshot tags.
  • $components - Comma separated list of screenshot components.
  • $versions - Comma separated list of screenshot versions.


 [[Screenshot(2,width=400,height=300,description=The $name by $author: $description,align=left)]]

For creating image maps you might consider using tools like

[[ScreenshotsList()]] macro displays list of all available screenshots on wiki page. Accepts one argument which is template for list items fromatting. Possible variables in this template are:

  • $id - ID of image.
  • $name - Name of image.
  • $author - User name who uploaded image.
  • $time - Time when image was uploaded.
  • $file - File name of image.
  • $description - Detailed description of image.
  • $width - Original width of image.
  • $height - Original height of image.
  • $tags - Comma separated list of screenshot tags.
  • $components - Comma separated list of screenshot components.
  • $versions - Comma separated list of screenshot versions.


 [[ScreenshotsList($name - $description ($widthx$height))]]


Previous revisions used space separated list of values in trac.ini configuration options. Now it uses comma separated list so change this to prevent inconveniences.


Are you using this plugin?
  • Yes, it's usefull. (sgrayban, cboos, okaori, wadeb, s0undt3ch, ttressieres, imme, dh1jc, talameelombu, Tharban, athomas, jtuchscherer, xvirus, osimons, Sincklation, manni, izzy, ericalens, KevinGabbert, mwehr, renzo, marcvs, eskil, rjollos, koolhand, edo, colski, dfleming, lucasrangit, miezuit, lhr870630, hasienda, arnisandy, lucid, AdrianFritz, akliewer99, AmigaAbattoir, laijinman, ntmlod)
  • No, it's useless. (falkb)
  • No, I don't need it. (dfaerch, harmy, prz)

  • You don't have permission to vote. You may need to login.

Change Log

16397 by rjollos on 2017-03-25 09:37:00
Remove obsolete "0.9" code
16191 by rjollos on 2017-01-21 03:51:42
1.2dev: Adapt to Trac 1.2 API

The changes need additional testing. Please be sure to
backup your environment before upgrading, and preferably
test in a sandbox first. Report any issues to #13007.

Fixes #13007.

13303 by hasienda on 2013-06-23 13:10:27
ScreenshotsPlugin: Use own actions instead of 'WIKI_*' for tagging action permission checks, closes #10940.

Fixing the issue for the two most current branches simultaneously.

12139 by rjollos on 2012-10-10 01:54:13
Fixed incorrect source code encoding (
8987 by Blackhex on 2010-09-20 12:56:24


  • Fixing #7701 and other PosgreSQL related problems.
  • Trac 0.11.5 dependency for 0.11 branch added.


Author: Blackhex

Attachments (1)

Download all attachments as: .zip