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
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
Return values
typeformatData()
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
Return values
stringformatExposure()
Formats the exposure value.
public
static formatExposure(type $data) : type
Parameters
- $data : type
Tags
Return values
typeformatGPS()
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
Return values
string|intget35mmEquivFocalLength()
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
Return values
intgetImageHeight()
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
intgetImageWidth()
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
intrationalNum()
Convert a fractional representation to something more user friendly
public
static rationalNum(string $data) : string
Parameters
- $data : string