ZenphotoCMS 1.6.5

imageMetaFormatter
in package

Class to handle metadata formatting

Partly adapted from: Exifer 1.7

Originally created by: Copyright © 2005 Jake Olefsky http:// www.offsky.com/software/exif/index.php jake@olefsky.com

Tags
since
1.6.5

Table of Contents

Methods

convertToFraction()  : type
Converts a floating point number into a simple fraction.
formatData()  : string
Formats metadata. Meta fields not handled are returned as strings/raw
formatExposure()  : type
Formats the exposure value.
formatGPS()  : string|int
Formats GPS data
get35mmEquivFocalLength()  : int
Calculates the 35mm-equivalent focal length from the reported sensor resolution
getImageHeight()  : int
Returns the image height from the COMPUTED array or if present for EXIFImageLength or EXIFImageHeight
getImageWidth()  : int
Returns the image width from the COMPUTED array or if present for EXIFImageWidth
rationalNum()  : string
Convert a fractional representation to something more user friendly

Methods

convertToFraction()

Converts a floating point number into a simple fraction.

public static convertToFraction(type $v, type &$n, type &$d) : type
Parameters
$v : type
$n : type
$d : type
Tags
since
1.6.3

Adapted from Exifer library to xmpMetaData plugin

since
1.6.5

Moved to class imageMetaFormatter

author

Jake Olefsky jake@olefsky.com, adapted by Malte Müller (acrylian)

Return values
type

formatData()

Formats metadata. Meta fields not handled are returned as strings/raw

public static formatData(type $tag, mixed $data[, array<string|int, mixed> $exifdata = array() ]) : string
Parameters
$tag : type

The metadata name of the field (not the db name!)

$data : mixed

The value to format

$exifdata : array<string|int, mixed> = array()

The full exif data as return by exif_read_data()

Tags
TODO

Since this traditionally formats EXIF fields only

since
1.6.5

Partly adapted from Exifer 1.7 library

author

Jake Olefsky jake@olefsky.com, adapted by Malte Müller (acrylian)

Return values
string

formatExposure()

Formats the exposure value.

public static formatExposure(type $data) : type
Parameters
$data : type
Tags
since
1.6.3
since
1.6.3

Adapted from Exifer 1.7 to xmpMetaData plugin

since
1.6.5

Moved to class imageMeta

author

Jake Olefsky jake@olefsky.com, adapted by Malte Müller (acrylian)

Return values
type

formatGPS()

Formats GPS data

public static formatGPS(string $tag, mixed $data) : string|int

This is for storinng in the db because it's structure as returned cannot be stored properly and also will conflict with geodata usages in maps and elsewhere

Parameters
$tag : string

Field name (not db column name!)

$data : mixed

Field value

Tags
since
1.6.5

Adapted from Exifer 1.7

author

Jake Olefsky jake@olefsky.com, adapted by Malte Müller (acrylian)

Return values
string|int

get35mmEquivFocalLength()

Calculates the 35mm-equivalent focal length from the reported sensor resolution

public static get35mmEquivFocalLength(array<string|int, mixed> $exifdata) : int

Used for output formatting.

Parameters
$exifdata : array<string|int, mixed>

The full exif data array as returned by exif_read_data() as formatting depends on several fields

Tags
since
1.6.5

Adapted from Exifer 1.7

author

Tristan Harward (trisweb)

Return values
int

getImageHeight()

Returns the image height from the COMPUTED array or if present for EXIFImageLength or EXIFImageHeight

public static getImageHeight(array<string|int, mixed> $exifdata) : int
Parameters
$exifdata : array<string|int, mixed>

The full Exif data as returnd by exif_read_data();

Return values
int

getImageWidth()

Returns the image width from the COMPUTED array or if present for EXIFImageWidth

public static getImageWidth(array<string|int, mixed> $exifdata) : int
Parameters
$exifdata : array<string|int, mixed>

The full Exif data as returnd by exif_read_data();

Return values
int

rationalNum()

Convert a fractional representation to something more user friendly

public static rationalNum(string $data) : string
Parameters
$data : string
Tags
since
1.6.5

moved from xmpMetaData plugin to class imageMetaFormatter

author

Stephen Billard (sbillard)

Return values
string

        
On this page

Search results