MediaWiki REL1_33
IPTC Class Reference

Class for some IPTC functions. More...

Static Public Member Functions

static getCharset ( $tag)
 take the value of 1:90 tag and returns a charset
 
static parse ( $rawData)
 This takes the results of iptcparse() and puts it into a form that can be handled by mediawiki.
 

Static Private Member Functions

static convIPTC ( $data, $charset)
 Helper function to convert charset for iptc values.
 
static convIPTCHelper ( $data, $charset)
 Helper function of a helper function to convert charset for iptc values.
 
static timeHelper ( $date, $time, $charset)
 Convert an iptc date and time tags into the exif format.
 

Detailed Description

Class for some IPTC functions.

Definition at line 29 of file IPTC.php.

Member Function Documentation

◆ convIPTC()

static IPTC::convIPTC ( $data,
$charset )
staticprivate

Helper function to convert charset for iptc values.

Parameters
string | array$dataThe iptc string
string$charset
Returns
string|array

Definition at line 411 of file IPTC.php.

References $data, and(), and convIPTCHelper().

Referenced by parse(), and timeHelper().

◆ convIPTCHelper()

static IPTC::convIPTCHelper ( $data,
$charset )
staticprivate

Helper function of a helper function to convert charset for iptc values.

Parameters
string | array$dataThe IPTC string
string$charset
Returns
string

Definition at line 430 of file IPTC.php.

References $data, and(), convIPTCHelper(), and wfDebugLog().

Referenced by convIPTC(), and convIPTCHelper().

◆ getCharset()

static IPTC::getCharset ( $tag)
static

take the value of 1:90 tag and returns a charset

Parameters
string$tag1:90 tag.
Returns
string Charset name or "?" Warning, this function does not (and is not intended to) detect all iso 2022 escape codes. In practise, the code for utf-8 is the only code that seems to have wide use. It does detect that code.

Definition at line 462 of file IPTC.php.

References and(), and wfDebugLog().

Referenced by parse(), and IPTCTest\testRecognizeUtf8().

◆ parse()

static IPTC::parse ( $rawData)
static

This takes the results of iptcparse() and puts it into a form that can be handled by mediawiki.

Generally called from BitmapMetadataHandler::doApp13.

See also
http://www.iptc.org/std/IIM/4.1/specification/IIMV4.1.pdf
Parameters
string$rawDataThe app13 block from jpeg containing iptc/iim data
Returns
array IPTC metadata array

Definition at line 40 of file IPTC.php.

References $data, $time, $titles, and(), convIPTC(), getCharset(), timeHelper(), and wfDebugLog().

Referenced by BitmapMetadataHandler\doApp13(), IPTCTest\testIPTCParseForcedUTFButInvalid(), IPTCTest\testIPTCParseMulti(), IPTCTest\testIPTCParseNoCharset88591(), IPTCTest\testIPTCParseNoCharset88591b(), IPTCTest\testIPTCParseNoCharsetUTF8(), and IPTCTest\testIPTCParseUTF8().

◆ timeHelper()

static IPTC::timeHelper ( $date,
$time,
$charset )
staticprivate

Convert an iptc date and time tags into the exif format.

Todo
Potentially this should also capture the timezone offset.
Parameters
array$dateThe date tag
array$timeThe time tag
string$charset
Returns
string Date in EXIF format.

Definition at line 343 of file IPTC.php.

References $time, and(), convIPTC(), list, wfDebugLog(), and wfTimestamp().

Referenced by parse().


The documentation for this class was generated from the following file: