soo_image user guide Page 12 of 16 « »
Exif tags
- soo_exif
- soo_exif_field
- soo_exif_value
Retrieve and display EXIF metadata directly from image files. In single-tag mode each field will be displayed in the format “field: value”. This can be customized with the format
attribute.
In container-tag mode the tag contents are iterated over, once for each EXIF field; use the soo_exif_field
and soo_exif_value
tags to display the data. That is, the tag contents are like a Txp form. The following two blocks are equivalent:
<txp:soo_exif />
<txp:soo_exif> <txp:soo_exif_field />: <txp:soo_exif_value /> </txp:soo_exif>
Requirements
soo_exif
uses PHP’s exif_read_data()
function, which requires PHP to be compiled with −−enable-exif
(you can check this by running phpinfo()). It requires a full file path for the image; this plugin only works for image files in your default Txp image directory (they don’t have to be in the Txp database, though).
Attributes
field
(text) Comma-separated list of fields to display. Use standard EXIF field names or shortcuts (see below). Additional options:- default (empty) : Display a pre-set list of common fields
dump
: Display all fields
format="format string"
Default is “{field}: {value}”. In single-tag mode the tag will output this string, after any occurences of “{field}” have been replaced with the EXIF field name; likewise for “{value}” and the EXIF field value.wraptag="tag name"
Tag name (no brackets) for element to wrap the anchorbreak="mixed"
Tag name (no brackets) or text to add between items
Field-name shortcuts
These are the same as used by EXIFUtils, a command-line utility for manipulating EXIF data.
EXIF field | Shortcut |
---|---|
Model | model |
ExposureTime | exp-time |
FNumber | f-number |
ISOSpeedRatings | iso-speed |
DateTimeOriginal | date-taken |
FocalLength | focal-len |
ImageHistory | history |
Additional fields
If the FocalLengthIn35mmFilm
field is available, soo_exif computes two additional values:
Computed field | Shortcut | Description |
---|---|---|
FOV | fov | Field of view (assumes rectilinear lens) |
CropFactor | crop | Crop factor |
Default fields
If no field
is specified, soo_exif
will show the all fields listed above.
soo_exif_field, soo_exif_value
When placed in a soo_exif
container tag, these tags display the EXIF field name and value, respectively. Each is a single tag and accepts the standard wraptag
attribute. As shown above, soo_exif
converts some field names to a more readable format; the same is true for some field values. (The DateTimeOriginal
field is converted to the date format from your Txp preferences.)
Examples
My default image form for single images (shown in action here) includes a table for EXIF data:
<table cellspacing="0"><tbody> <txp:soo_exif wraptag="tr" break="th" format="{field}" /> <txp:soo_exif wraptag="tr" break="td" format="{value}" /> </tbody></table>
Camera | Shutter speed | F-stop | ISO speed | Exposure date | Focal length | Crop factor | Computed FOV |
---|---|---|---|---|---|---|---|
PENTAX K10D | 1/125 | ƒ/8 | 100 | 5 December 2008 | 200mm | 1.5 | 8.2° |
It uses two soo_exif
tags because I wanted a horizontal table, i.e., headers along the top. To get the same information as a vertical table:
<txp:soo_exif wraptag="table" break="tr"> <txp:soo_exif_field wraptag="th" /><txp:soo_exif_value wraptag="td" /> </txp:soo_exif>
The vertical table could even be done in one tag:
<txp:soo_exif wraptag="table" break="tr" format="<th>{field}</th><td>{value}</td>" />
Specified fields with minimal formatting:
<txp:soo_exif field="model,date-taken" break="; " />
Camera: PENTAX K10D; Exposure date: 5 December 2008
To see all EXIF data use “dump“ for the field
value.
FileDateTime: 1242581498
FileSize: 52132
FileType: 2
MimeType: image/jpeg
SectionsFound: ANY_TAG, IFD0, COMMENT, EXIF
COMPUTED: width="453" height="680" 680 453 1 1 f/8.0
Make: PENTAX Corporation
Camera: PENTAX K10D
Orientation: 1
XResolution: 4718592/65536
YResolution: 4718592/65536
ResolutionUnit: 2
Software: QuickTime 7.6
DateTime: 2009:05:17 08:39:16
HostComputer: Mac OS X 10.5.7
YCbCrPositioning: 1
Exif_IFD_Pointer: 252
COMMENT: AppleMark
Shutter speed: 1/125
F-stop: ƒ/8
ExposureProgram: 3
ISO speed: 100
ExifVersion: 0220
Exposure date: 5 December 2008
DateTimeDigitized: 2008:12:05 16:31:38
ShutterSpeedValue: 696/100
ApertureValue: 6000/1000
ExposureBiasValue: 0/10
MeteringMode: 2
Flash: 16
Focal length: 200mm
ColorSpace: 1
ExifImageWidth: 453
ExifImageLength: 680
ExposureMode: 0
WhiteBalance: 0
FocalLengthIn35mmFilm: 300mm
Crop factor: 1.5
Computed FOV: 8.2°