create new tag
view all tags


Display EXIF (Exchangeable Image File) data for JPEG images attached to a topic


Most current digital camera store images using EXIF (Exchangeable Image File) compressed files. EXIF is a standard defined by the Japan Electronic Industry Development Association and supports the storage of extended camera information within the header of a JPEG file. ExifMetaDataPlugin is a TWiki plugin that make use of the EXIF standard. It displays EXIF data for images attached to a topic.

Syntax Rules

The %EXIFMETADATA{...}% variable gets expanded to the EXIF data extracted from the image specified by the file parameter.

Parameters Comment Example
"..." or
File name of the EXIF file to process. "picture.jpg"
topic="..." Topic where the EXIF file is attached to; format "TopicName" or "Web.TopicName". Default is the current topic. topic="Sandbox.TestExif"
tags="..." User specified list of EXIF tags to show. Default is "33434,33437,34855,36867,37386". See below for a list of supported tags. You may specify all to read all supported EXIF tags from the file. tags="271,305"

Supported EXIF Tags

Number Description
270 Describes image
271 Shows manufacturer of digital camera
272 Shows model number of digital camera
305 Shows firmware version number.
306 Date/Time of image was last modified. Data format is "YYYY:MM:DD HH:MM:SS". In usual, it has the same value of 36867
33434 Exposure time (reciprocal of shutter speed if shorter than one second).
33437 F-stop of lens when the image was taken.
34855 ISO speed (CCD sensitivity equivalent to film speed-rate).
36867 Date/Time of original image taken. This value should not be modified by user program.
36868 Date/Time of image digitized. Usually, it contains the same value of 36867.
37386 Focal length of lens used to take image.
37510 User comment (ASCII only).

Error Codes

If the EXIF data can not be obtained for some reason, the %EXIFMETADATA{...}% variable gets expanded to an error code.

Code Description
EXIF-ERROR-01 No file attribute specified.
EXIF-ERROR-02 Can't open file.
EXIF-ERROR-03 No exif data.
EXIF-ERROR-04 APP1 does not contain EXIF data.
EXIF-ERROR-05 Invalid byte alignment.
EXIF-ERROR-06 Invalid tag mark.
EXIF-ERROR-07 Error reading block length.


Write %EXIFMETADATA{ "picture.jpg" tags="271,272" }% to get the manufacturer and model name of tha camera used to take the image in the file picture.jpg.

Variable Expected Output If Installed
%EXIFMETADATA{ "picture.jpg" }% 1/125 sec, f2.6, ISO100, 2004:01:17 22:17:13, 8mm 1/125 sec, f2.6, ISO100, 2004:01:17 22:17:13, 8mm
%EXIFMETADATA{ "picture.jpg" tags="271,305" }% NIKON, E4500v1.2 NIKON, E4500v1.2

Plugin Settings

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Display EXIF (Exchangeable Image File) data for JPEG images attached to a topic

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 0

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.

  • For an automated installation, run the configure script and follow "Find More Extensions" in the in the Extensions section.

  • Or, follow these manual installation steps:
    • Download the ZIP file from the Plugins home (see below).
    • Unzip ExifMetaDataPlugin.zip in your twiki installation directory. Content:
      File: Description:
      data/TWiki/ExifMetaDataPlugin.txt Plugin topic
      pub/TWiki/ExifMetaDataPlugin/picture.jpg Sample JPEG file
      lib/TWiki/Plugins/ExifMetaDataPlugin.pm Plugin Perl module
    • Set the ownership of the extracted directories and files to the webserver user.

  • Plugin configuration and testing:
    • Run the configure script, and enable the plugin in the Plugins section.
    • Test if the installation was successful: See above example if you get the proper result in the "If Installed" column.

Plugin Info

Plugin Author: TWiki:Main.PascalBuchbinder
Copyright: © 2004 TWiki:Main.PascalBuchbinder
© 2005-2011 TWiki:TWiki.TWikiContributor
License: GPL (GNU General Public License)
Plugin Version: 2011-07-15
Change History:  
2011-07-15: TWikibug:Item6764: Minor fix to remove warning message in error log; doc improvements -- TWiki:Main.PeterThoeny
2011-07-10: TWikibug:Item6725: Change global package variables from "use vars" to "our" -- TWiki:Main.PeterThoeny
2011-01-09: TWikibug:Item6530: Small code fix to remove warning -- TWiki:Main.PeterThoeny
2010-12-13: TWikibug:Item6530: Add topic="..." parameter; add nameless "..." parameter; change plugin to use registerTagHandler for better performance; doc improvements; changing TWIKIWEB to SYSTEMWEB -- TWiki:Main.PeterThoeny
02 Jul 2004: bug fix, don't process unknown IFD entries
30 Jan 2004: support for 37510
29 Jan 2004: round f-stop (33437)
19 Jan 2004: round focal length (37386) and enable debug messages
18 Jan 2004: Initial version
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
TWiki:Plugins/Benchmark: GoodStyle nn%, FormattedSearch nn%, ExifMetaDataPlugin nn%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/ExifMetaDataPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/ExifMetaDataPluginDev

Related Topics: TWikiPreferences, TWikiPlugins

Topic attachments
I Attachment History Action Size Date Who Comment
JPEGjpg picture.jpg r1 manage 41.0 K 2011-07-15 - 22:42 TWikiAdminUser Saved by install script
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | More topic actions
Topic revision: r3 - 2015-06-17 - TWikiAdminUser
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 1999-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.ExifMetaDataPlugin.