Add default IPTC properties for the given view mode to the end of current properties.
This is used on upgrade of the module from before IPTC times.
Parameters:
API Tags:
array getExifData(
string
$path, int
$viewMode
)
|
|
Return the wanted EXIF/IPTC data for one given file according to the given view mode.
This method doesn't return all available EXIF/IPTC data; instead it returns only the data existing and configured to be viewed in the given mode.
Parameters:
|
string |
$path: |
the path to the file |
|
int |
$viewMode: |
|
API Tags:
| Return: | GalleryStatus a status code array title/value pairs |
Return the EXIF/IPTC keys that we know about (from lib/Exifer and lib/JPEG).
The resulting array is of the form:
'G2 exif/iptc property 0' => ( 'internationalized title 0', 'physical exif property' [, 'another physical exif property', ...]) 'G2 exif/iptc property 1' => ( 'internationalized title 1', 'physical exif property' [, 'another physical exif property', ...]) ...
The G2 exif/iptc properties are unique and have some correlation to the physical properties, but have been changed for our convenience, especially allowing to access several physical exif/iptc properties for one and the same logical G2 exif/iptc property. The first existing physical property in the given order will be used and returned.
API Tags:
array getExifValue(
&$source, array
$keyPath, array
$source
)
|
|
Retrieve a single EXIF value by path from a nested associative array.
The data source is an array like this:
foo => ( bar => (a => 1, b => 2, c => 3), baz => (d => 4, e => 5, f => 6))
and the key path is an array like this:
(foo, baz, d)
the resulting value would be "4"
Parameters:
|
array |
$source: |
the data source |
|
array |
$keyPath: |
the key path |
|
|
&$source: |
|
API Tags:
| Return: | GalleryStatus a status code string value |
array getIptcObject(
string
$path
)
|
|
Return the raw IPTC data as a lib/JPEG object. This method call has the penalty to have to read in the lib/JPEG library (currently ~100KB) but nearly no penalties for the image: it isn't read here, that happens lazily when actually accessing IPTC values.
Parameters:
|
string |
$path: |
the path to a jpeg file |
API Tags:
Information Tags:
| Todo: | (xlerb) reduce size of lib/JPEG: 1. remove whitespace/comments; 2. refactor according to lazy reading. Before refactoring, add timing tests. |
string getIptcValue(
&$object, array
$keyPath, [string
$sourceEncoding = null], object
$object
)
|
|
Retrieve a single IPTC value out of the given JPEG object by key path.
If the key path starts with 'IPTC', the second part is assumed to contain the physical IPTC name, more parts are silently ignored. When the path does not start with 'IPTC', this method returns null.
Parameters:
|
object |
$object: |
A JPEG object containing the IPTC values |
|
array |
$keyPath: |
|
|
string |
$sourceEncoding: |
encoding of the IPTC value, e.g. 'ISO-8859-1', defaults from current locale |
|
|
&$object: |
|
API Tags:
| Return: | An IPTC value or null, if there is no such value or on error |
Information Tags:
| Todo: | (xlerb) have IPTC input charset default in EXIF/IPTC admin interface. |
| Todo: | (xlerb) have IPTC input charset overrides for albums (maybe images too?) for cases, where users from different countries can upload images with IPTC data. It is such a pain, that the charset used isn't recorded in IPTC headers. |
int getOriginationTimestamp(
string
$path
)
|
|
Return the timestamp when the picture was taken, as recorded in exif
Parameters:
|
string |
$path: |
the path to the file |
API Tags:
| Return: | an unix timestamp |
Information Tags:
| Todo: | (xlerb) check for IPTC.DateCreated and IPTC.TimeCreated additionally? Problem: only date set by Adobe in IPTC, set time to 0 = midnight or 12 = noon? Also, which priority has it: it was explicitely set by the editor, thus first priority? Or to be considered just before IFD0.DateTime == last modification time? |
array getProperties(
int
$viewMode
)
|
|
Return the target properties for the given view mode
Parameters:
|
int |
$viewMode: |
the view mode (EXIF_SUMMARY, etc) |
API Tags:
| Return: | GalleryStatus a status code array logical exif property names |
string postProcessValue(
string
$property, string
$value
)
|
|
Sometimes the values that are returned aren't quite as we'd like to present them, so do a little post processing on the text
Parameters:
|
string |
$property: |
the property name (eg. "ApertureValue") |
|
string |
$value: |
the value (eg. "f 2.8") |
API Tags:
| Return: | the result (eg. "f/2.8") |
Reset the given view mode back to its default settings
Parameters:
API Tags:
Set the target properties for the given view mode
Parameters:
|
int |
$viewMode: |
the view mode (EXIF_SUMMARY, etc) |
|
array |
$properties: |
logical property key/value pairs |
API Tags:
void _fetchRawExifData(
string
$path,
&$rawExifData, array
$rawExifData
)
|
|
Retrieve the raw EXIF data as returned by lib/Exifer.
Parameters:
|
string |
$path: |
the path to the file |
|
array |
$rawExifData: |
reference to an array where to store the results as returned by read_exif_data_raw() from exifer |
|
|
&$rawExifData: |
|
void _parseDate(
$value
)
|
|
Parse date string into unix timestamp.
Parameters:
API Tags: