soo_image user guide Page 12 of 16

Exif tags

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_field />: <txp:soo_exif_value />


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).


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.)


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}" />
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" />

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.