Exif Class Reference

List of all members.

Public Member Functions

 __construct ($file)
 Constructor.
 makeFlatExifTags ()
 #@+
 extractTags (&$tagset)
 A recursing extractor function used by makeFlatExifTags().
 makeFilteredData ()
 Make $this->mFilteredExifData.
 makeFormattedData ()
 getData ()
 #@-
 getFilteredData ()
 Get $this->mFilteredExifData.
 getFormattedData ()
 Get $this->mFormattedExifData.
 isByte ($in)
 #@+ Validates if a tag value is of the type it should be according to the Exif spec
 isASCII ($in)
 isShort ($in)
 isLong ($in)
 isRational ($in)
 isUndefined ($in)
 isSlong ($in)
 isSrational ($in)
 validate ($tag, $val)
 #@-
 debug ($in, $fname, $action=NULL)
 Convenience function for debugging output.
 debugFile ($fname, $io)
 Convenience function for debugging output.

Static Public Member Functions

static version ()
 #@-

Public Attributes

const BYTE = 1
 An 8-bit (1-byte) unsigned integer.
const ASCII = 2
 An 8-bit byte containing one 7-bit ASCII code. The final byte is terminated with NULL.
const SHORT = 3
 A 16-bit (2-byte) unsigned integer.
const LONG = 4
 A 32-bit (4-byte) unsigned integer.
const RATIONAL = 5
 Two LONGs. The first LONG is the numerator and the second LONG expresses the denominator.
const UNDEFINED = 7
 An 8-bit byte that can take any value depending on the field definition.
const SLONG = 9
 A 32-bit (4-byte) signed integer (2's complement notation),.
const SRATIONAL = 10
 Two SLONGs. The first SLONG is the numerator and the second SLONG is the denominator.
 $mExifTags
 Exif tags grouped by category, the tagname itself is the key and the type is the value, in the case of more than one possible value type they are separated by commas.
 $mFlatExifTags
 A one dimentional array of all Exif tags.
 $mRawExifData
 The raw Exif data returned by exif_read_data().
 $mFilteredExifData
 A Filtered version of $mRawExifData that has been pruned of invalid tags and tags that contain content they shouldn't contain according to the Exif specification.
 $mFormattedExifData
 Filtered and formatted Exif data, see FormatExif::getFormattedData().
 $file
 The file being processed.
 $basename
 The basename of the file being processed.
 $log = false
 The private log to log to, e.g.


Detailed Description

Todo:
document (e.g. one-sentence class-overview description)

Definition at line 30 of file Exif.php.


Constructor & Destructor Documentation

Exif::__construct ( file  ) 

Constructor.

Parameters:
$file String: filename.

Definition at line 104 of file Exif.php.

References $file, ASCII, BYTE, debugFile(), is(), LONG, makeFilteredData(), makeFlatExifTags(), makeFormattedData(), RATIONAL, SHORT, SRATIONAL, UNDEFINED, version(), wfBaseName(), wfRestoreWarnings(), and wfSuppressWarnings().


Member Function Documentation

Exif::debug ( in,
fname,
action = NULL 
)

Convenience function for debugging output.

Access:
private
Parameters:
$in Mixed:
$fname String:
$action Mixed: , default NULL.

Definition at line 561 of file Exif.php.

References $action, $in, $type, and wfDebugLog().

Referenced by isASCII(), isByte(), isLong(), isRational(), isShort(), isSlong(), isSrational(), isUndefined(), makeFilteredData(), and validate().

Exif::debugFile ( fname,
io 
)

Convenience function for debugging output.

Access:
private
Parameters:
$fname String: the name of the function calling this function
$io Boolean: Specify whether we're beginning or ending

Definition at line 588 of file Exif.php.

References wfDebugLog().

Referenced by __construct().

Exif::extractTags ( &$  tagset  ) 

A recursing extractor function used by makeFlatExifTags().

Note: This used to use an array_walk function, but it made PHP5 segfault, see `cvs diff -u -r 1.4 -r 1.5 Exif.php`

Definition at line 328 of file Exif.php.

References $key.

Referenced by makeFlatExifTags().

Exif::getData (  ) 

#@-

#@+

Returns:
array Get $this->mRawExifData

Definition at line 374 of file Exif.php.

Exif::getFilteredData (  ) 

Get $this->mFilteredExifData.

Definition at line 381 of file Exif.php.

Referenced by makeFormattedData().

Exif::getFormattedData (  ) 

Get $this->mFormattedExifData.

Definition at line 388 of file Exif.php.

Exif::isASCII ( in  ) 

Definition at line 427 of file Exif.php.

References $in, and debug().

Referenced by validate().

Exif::isByte ( in  ) 

#@+ Validates if a tag value is of the type it should be according to the Exif spec

Access:
private
Parameters:
$in Mixed: the input value to check
Returns:
bool

Definition at line 417 of file Exif.php.

References $in, and debug().

Referenced by validate().

Exif::isLong ( in  ) 

Definition at line 455 of file Exif.php.

References $in, and debug().

Referenced by isRational(), isSlong(), and validate().

Exif::isRational ( in  ) 

Definition at line 465 of file Exif.php.

References $in, debug(), and isLong().

Referenced by validate().

Exif::isShort ( in  ) 

Definition at line 445 of file Exif.php.

References $in, and debug().

Referenced by validate().

Exif::isSlong ( in  ) 

Definition at line 485 of file Exif.php.

References $in, debug(), and isLong().

Referenced by isSrational(), and validate().

Exif::isSrational ( in  ) 

Definition at line 495 of file Exif.php.

References $in, debug(), and isSlong().

Referenced by validate().

Exif::isUndefined ( in  ) 

Definition at line 475 of file Exif.php.

References $in, and debug().

Referenced by validate().

Exif::makeFilteredData (  ) 

Make $this->mFilteredExifData.

Definition at line 341 of file Exif.php.

References debug(), and validate().

Referenced by __construct().

Exif::makeFlatExifTags (  ) 

#@+

Access:
private Generate a flat list of the exif tags

Definition at line 318 of file Exif.php.

References extractTags().

Referenced by __construct().

Exif::makeFormattedData (  ) 

Todo:
document

Definition at line 362 of file Exif.php.

References getFilteredData().

Referenced by __construct().

Exif::validate ( tag,
val 
)

#@-

Validates if a tag has a legal value according to the Exif spec

Access:
private
Parameters:
$tag String: the tag to check.
$val Mixed: the value of the tag.
Returns:
bool

Definition at line 515 of file Exif.php.

References ASCII, BYTE, debug(), isASCII(), isByte(), isLong(), isRational(), isShort(), isSlong(), isSrational(), isUndefined(), LONG, RATIONAL, SHORT, SLONG, SRATIONAL, and UNDEFINED.

Referenced by makeFilteredData().

static Exif::version (  )  [static]

#@-

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.

Returns:
int

Definition at line 405 of file Exif.php.

Referenced by __construct(), BitmapHandler::getMetadata(), and BitmapHandler::isMetadataValid().


Member Data Documentation

Exif::$basename

The basename of the file being processed.

Definition at line 90 of file Exif.php.

Exif::$file

The file being processed.

Definition at line 85 of file Exif.php.

Referenced by __construct().

Exif::$log = false

The private log to log to, e.g.

'exif'

Definition at line 95 of file Exif.php.

Exif::$mExifTags

Exif tags grouped by category, the tagname itself is the key and the type is the value, in the case of more than one possible value type they are separated by commas.

Definition at line 51 of file Exif.php.

Exif::$mFilteredExifData

A Filtered version of $mRawExifData that has been pruned of invalid tags and tags that contain content they shouldn't contain according to the Exif specification.

Definition at line 68 of file Exif.php.

Exif::$mFlatExifTags

A one dimentional array of all Exif tags.

Definition at line 56 of file Exif.php.

Exif::$mFormattedExifData

Filtered and formatted Exif data, see FormatExif::getFormattedData().

Definition at line 73 of file Exif.php.

Exif::$mRawExifData

The raw Exif data returned by exif_read_data().

Definition at line 61 of file Exif.php.

const Exif::ASCII = 2

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

Definition at line 33 of file Exif.php.

Referenced by __construct(), and validate().

const Exif::BYTE = 1

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

Definition at line 32 of file Exif.php.

Referenced by __construct(), and validate().

const Exif::LONG = 4

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

Definition at line 35 of file Exif.php.

Referenced by __construct(), and validate().

const Exif::RATIONAL = 5

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

Definition at line 36 of file Exif.php.

Referenced by __construct(), and validate().

const Exif::SHORT = 3

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

Definition at line 34 of file Exif.php.

Referenced by __construct(), and validate().

const Exif::SLONG = 9

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

Definition at line 38 of file Exif.php.

Referenced by validate().

const Exif::SRATIONAL = 10

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

Definition at line 39 of file Exif.php.

Referenced by __construct(), and validate().

const Exif::UNDEFINED = 7

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

Definition at line 37 of file Exif.php.

Referenced by __construct(), and validate().


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

Generated on Sat Sep 5 02:08:36 2009 for MediaWiki by  doxygen 1.5.9