ExifMetaDataPlugin
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 |
file | File name of the EXIF file to process. The file must be attched to the topic. | file="picture.jpg" |
tags | User specifed 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 |
37510 | User comment (ASCII only). |
272 | Shows model number of digicam |
271 | Shows manufacturer of digicam |
305 | Shows firmware version number. |
34855 | ISO speed (CCD sensitivity equivalent to film speedrate). |
37386 | Focal length of lens used to take image. |
33437 | F-stop of lens when the image was taken. |
33434 | Exposure time (reciprocal of shutter speed if shorter than one second). |
270 | Describes image |
36867 | Date/Time of original image taken. This value should not be modified by user program. |
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 |
36868 | Date/Time of image digitized. Usually, it contains the same value of 36867. |
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. |
Examples
Write
%EXIFMETADATA{ file="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 | Output |
%EXIFMETADATA{ file="picture.jpg" }% | EXIF-ERROR-02 |
%EXIFMETADATA{ file="picture.jpg" tags="271,305" }% | EXIF-ERROR-02 |
Plugin Settings
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Displays EXIF data for jpeg images attached to a topic.
- Debug plugin: (See output in
data/debug.txt)
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 server where TWiki is running.
- Download the ZIP file from the Plugin web (see below)
- Unzip
ExifMetaDataPlugin.zip in your twiki installation directory. Content: | File: | Description: |
data/TWiki/ExifMetaDataPlugin.txt | Plugin topic |
data/TWiki/ExifMetaDataPlugin.txt,v | Plugin topic repository |
pub/TWiki/ExifMetaDataPlugin/picture.jpg | Sample jpeg file |
lib/TWiki/Plugins/ExifMetaDataPlugin.pm | Plugin Perl module |
- Test if the installation was successful: Write
%EXIFMETADATA% anywhere in a topic. The variable gets expanded to the error message EXIF-ERROR-01.
Plugin Info
Related Topics: TWikiPreferences,
TWikiPlugins
--
TWiki:Main/PascalBuchbinder - 18 Jan 2004