BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
Exif Class Reference
Collaboration diagram for Exif:

Public Member Functions

 __construct ($file, $byteOrder= '')
 makeFilteredData ()
 collapseData ()
 getData ()
 getFilteredData ()

Static Public Member Functions

static version ()

Public Attributes

const BYTE = 1
const ASCII = 2
const SHORT = 3
const LONG = 4
const RATIONAL = 5
const SHORT_OR_LONG = 6
const UNDEFINED = 7
const SLONG = 9
const SRATIONAL = 10
const IGNORE = -1

Detailed Description

Class to extract and validate Exif data from jpeg (and possibly tiff) files.

Constructor & Destructor Documentation

Exif::__construct (   $file,
  $byteOrder = '' 
string$byteOrderType of byte ordering either 'BE' (Big Endian) or 'LE' (Little Endian). Default ''.
FIXME: The following are broke: SubjectArea. Need to test the more obscure tags. DigitalZoomRatio = 0/0 is rejected. need to determine if that's valid. Possibly should treat 0/0 = 0. need to read exif spec on that.

Page numbers here refer to pages in the Exif 2.2 standard

Note, Exif::UNDEFINED is treated as a string, not as an array of bytes so don't put a count parameter for any UNDEFINED values.

The Exif 2.2 specification exif_read_data() will return false on invalid input, such as when somebody uploads a file called something.jpeg containing random gibberish.

Member Function Documentation

Exif::collapseData ( )

Collapse some fields together. This converts some fields from exif form, to a more friendly form. For example GPS latitude to a single number.

The rationale behind this is that we're storing data, not presenting to the user For example a longitude is a single number describing how far away you are from the prime meridian. Well it might be nice to split it up into minutes and seconds for the user, it doesn't really make sense to split a single number into 4 parts for storage. (degrees, minutes, second, direction vs single floating point number).

Other things this might do (not really sure if they make sense or not): Dates -> mediawiki date format. convert values that can be in different units to be in one standardized unit.

As an alternative approach, some of this could be done in the validate phase if we make up our own types like Exif::DATE.

Exif::getData ( )

#@- #@+

array Get $this->mRawExifData
Exif::getFilteredData ( )

Get $this->mFilteredExifData

Exif::makeFilteredData ( )

Make $this->mFilteredExifData

static Exif::version ( )

#@- The version of the output format

Before the actual metadata information is saved in the database we strip some of it since we don't want to save things like thumbnails which usually accompany Exif data. This value gets saved in the database along with the actual Exif data, and if the version in the database doesn't equal the value returned by this function the Exif data is regenerated.


Member Data Documentation

const Exif::ASCII = 2

An 8-bit byte containing one 7-bit ASCII code. The final byte is terminated with NULL.

const Exif::BYTE = 1

An 8-bit (1-byte) unsigned integer.

const Exif::IGNORE = -1

A fake value for things we don't want or don't support.

const Exif::LONG = 4

A 32-bit (4-byte) unsigned integer.

const Exif::RATIONAL = 5

Two LONGs. The first LONG is the numerator and the second LONG expresses the denominator

const Exif::SHORT = 3

A 16-bit (2-byte) unsigned integer.

const Exif::SHORT_OR_LONG = 6

A 16-bit (2-byte) or 32-bit (4-byte) unsigned integer.

const Exif::SLONG = 9

A 32-bit (4-byte) signed integer (2's complement notation),

const Exif::SRATIONAL = 10

Two SLONGs. The first SLONG is the numerator and the second SLONG is the denominator.

const Exif::UNDEFINED = 7

An 8-bit byte that can take any value depending on the field definition

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