Documentation

Horde_Image_Exif
in package

General class for fetching and parsing EXIF information from images.

Works equally well with either the built in php exif functions (if PHP compiled with exif support), the Exiftool package (more complete but slower), or the bundled exif library.

Tags
author

Chuck Hagenbuch chuck@horde.org

author

Michael J. Rubinsky mrubinsk@horde.org

category

Horde

copyright

2003-2017 Horde LLC

license

http://www.horde.org/licenses/lgpl21 LGPL-2.1

Table of Contents

$_descriptionFields  : mixed
$_titleFields  : mixed
factory()  : Horde_Image_Exif
Factory method for instantiating a Horde_Image_Exif object.
getCategories()  : array<string|int, mixed>
Obtains an array of supported meta data fields.
getDescriptionFields()  : array<string|int, mixed>
Returns a list of metadata fields that can by used for image descriptions.
getFields()  : array<string|int, mixed>
Returns a flattened array of supported metadata fields.
getHumanReadable()  : string
Converts an exif field into human-readable form.
getTitleFields()  : array<string|int, mixed>
Returns a list of metadata fields that can by used for image titles.
intel2Moto()  : string
Converts from Intel to Motorola endien.
_convertToFraction()  : mixed
Converts a floating point number into a fraction.
_formatExposure()  : mixed
More human friendly exposure formatting.

Properties

$_descriptionFields

protected static mixed $_descriptionFields = array('IPTC' => array('Caption-Abstract'), 'XMP' => array('Description'), 'EXIF' => array('ImageDescription'), 'COMPOSITE' => array())

$_titleFields

protected static mixed $_titleFields = array('IPTC' => array('ObjectName'), 'XMP' => array('Title'), 'EXIF' => array(), 'COMPOSITE' => array())

Methods

factory()

Factory method for instantiating a Horde_Image_Exif object.

public static factory([string $driver = null ][, array<string|int, mixed> $params = array() ]) : Horde_Image_Exif
Parameters
$driver : string = null
$params : array<string|int, mixed> = array()
Return values
Horde_Image_Exif

getCategories()

Obtains an array of supported meta data fields.

public static getCategories() : array<string|int, mixed>
Tags
TODO:

This should probably be extended by the subclass?

Return values
array<string|int, mixed>

getDescriptionFields()

Returns a list of metadata fields that can by used for image descriptions.

public static getDescriptionFields([mixed $driver = null ]) : array<string|int, mixed>
Parameters
$driver : mixed = null

A Horde_Image_Exif_Base instance or a string specifying the driver in use.

Tags
since
2.1.0
Return values
array<string|int, mixed>

An array of metadata field hashes.

getFields()

Returns a flattened array of supported metadata fields.

public static getFields([mixed $driver = null ][, bool $description_only = false ]) : array<string|int, mixed>
Parameters
$driver : mixed = null

A Horde_Image_Exif_Base instance or a string specifying the driver in use.

$description_only : bool = false

Only return the field descriptions.

Return values
array<string|int, mixed>

getHumanReadable()

Converts an exif field into human-readable form.

public static getHumanReadable(string $field, string $data) : string

Some of these cases are ported from the Exifer library, others were changed from their implementation where the EXIF standard dictated different behaviour.

Parameters
$field : string

The name of the field to translate.

$data : string

The data value to translate.

Return values
string

The converted data.

getTitleFields()

Returns a list of metadata fields that can by used for image titles.

public static getTitleFields([mixed $driver = null ]) : array<string|int, mixed>
Parameters
$driver : mixed = null

A Horde_Image_Exif_Base instance or a string specifying the driver in use.

Tags
since
2.1.0
Return values
array<string|int, mixed>

An array of metadata field name hashes.

intel2Moto()

Converts from Intel to Motorola endien.

public static intel2Moto(string $intel) : string

Just reverses the bytes (assumes hex is passed in)

Parameters
$intel : string
Return values
string

_convertToFraction()

Converts a floating point number into a fraction.

protected static _convertToFraction(mixed $v, mixed &$n, mixed &$d) : mixed

Many thanks to Matthieu Froment for this code.

(Ported from the Exifer library).

Parameters
$v : mixed
$n : mixed
$d : mixed
Return values
mixed

_formatExposure()

More human friendly exposure formatting.

protected static _formatExposure(mixed $data) : mixed
Parameters
$data : mixed
Return values
mixed

Search results