Image_JpegXmpReader
[ class tree: Image_JpegXmpReader ] [ index: Image_JpegXmpReader ] [ all elements ]

Class: Image_JpegXmpReader

Source Location: /Image_JpegXmpReader-0.5.3/Image/JpegXmpReader.php

Class Overview

Image_JpegMarkerReader
   |
   --Image_JpegXmpReader

Read Photoshop-style XMP metadata from a JPEG file with reasonable efficiency.


Author(s):

Copyright:

  • 2008 P'unk Avenue LLC

Methods


Inherited Variables

Inherited Methods


Class Details

[line 65]
Read Photoshop-style XMP metadata from a JPEG file with reasonable efficiency.


[ Top ]


Method Detail

__construct (Constructor)   [line 73]

Image_JpegXmpReader __construct( string $filename)

Creates a new JpegXmpReader object which will read from the specified file
  • Access: public

Parameters:

string   $filename   —  file to open

[ Top ]

getCreator   [line 331]

boolean|string getCreator( )

Retrieve creator field or fields as a single string

Returns a string consisting of all creator fields found in the XMP metadata. If more than one is present, they are joined by newlines. If there are no valid XMP metadata markers in the file, this function returns false.

If an unexpected condition occurs, such as failure to open the file or a file which is not a valid JPEG datastream, a Image_JpegMarkerReaderOpenException or Image_JpegMarkerReaderDamagedException will be thrown.

See also getCreators().

  • Access: public

[ Top ]

getCreators   [line 307]

boolean|array getCreators( )

Retrieve creator fields

Returns an array consisting of all creator fields found in the XMP metadata (most images only have one, so you may prefer to call getCreator()).

Returns false if no valid XMP metadata markers are present in the file.

If an unexpected condition occurs, such as failure to open the file or a file which is not a valid JPEG datastream, a Image_JpegMarkerReaderOpenException or Image_JpegMarkerReaderDamagedException will be thrown.

See also getCreator().

  • Access: public

[ Top ]

getDescription   [line 233]

boolean|string getDescription( )

Retrieve description field or fields as a single string

Returns a string consisting of all description fields found in the XMP metadata. If more than one is present, they are joined by newlines. If there are no valid XMP metadata markers in the file, this function returns false.

If an unexpected condition occurs, such as failure to open the file or a file which is not a valid JPEG datastream, a Image_JpegMarkerReaderOpenException or Image_JpegMarkerReaderDamagedException will be thrown.

See also getDescriptions().

  • Access: public

[ Top ]

getDescriptions   [line 209]

boolean|array getDescriptions( )

Retrieve description fields

Returns an array consisting of all description fields found in the XMP metadata (most images only have one, so you may prefer to call getTitle()).

Returns false if no valid XMP metadata markers are present in the file.

If an unexpected condition occurs, such as failure to open the file or a file which is not a valid JPEG datastream, a Image_JpegMarkerReaderOpenException or Image_JpegMarkerReaderDamagedException will be thrown.

See also getDescription().

  • Access: public

[ Top ]

getField   [line 359]

boolean|array getField( string $field)

Retrieve all instances of a specified field

Returns an array consisting of all instances of a specified field found in the XMP metadata.

Returns false if no valid XMP metadata markers are present in the file.

Also returns false if the specified field is not present.

If an unexpected condition occurs, such as failure to open the file or a file which is not a valid JPEG datastream, a Image_JpegMarkerReaderOpenException or Image_JpegMarkerReaderDamagedException will be thrown.

See also getImplodedField().

  • Access: public

Parameters:

string   $field   —  field name to fetch

[ Top ]

getImplodedField   [line 392]

boolean|string getImplodedField( string $field)

Retrieve all instances of a specified field as a single string

Returns a string consisting of all occurrences of the specified field found in the XMP metadata. If more than one is present, they are joined by newlines. If there are no valid XMP metadata markers in the file, this function returns false. This function also returns false if the specified field does not occur in the file.

If an unexpected condition occurs, such as failure to open the file or a file which is not a valid JPEG datastream, a Image_JpegMarkerReaderOpenException or Image_JpegMarkerReaderDamagedException will be thrown.

See also getCreators().

  • Access: public

Parameters:

string   $field   —  field name to fetch

[ Top ]

getSubject   [line 282]

boolean|string getSubject( )

Retrieve subject field or fields as a single string

Returns a string consisting of all subject fields found in the XMP metadata. If more than one is present, they are joined by newlines. If there are no valid XMP metadata markers in the file, this function returns false.

If an unexpected condition occurs, such as failure to open the file or a file which is not a valid JPEG datastream, a Image_JpegMarkerReaderOpenException or Image_JpegMarkerReaderDamagedException will be thrown.

See also getSubjects().

  • Access: public

[ Top ]

getSubjects   [line 258]

boolean|array getSubjects( )

Retrieve subject fields

Returns an array consisting of all subject fields found in the XMP metadata (most images only have one, so you may prefer to call getSubject()).

Returns false if no valid XMP metadata markers are present in the file.

If an unexpected condition occurs, such as failure to open the file or a file which is not a valid JPEG datastream, a Image_JpegMarkerReaderOpenException or Image_JpegMarkerReaderDamagedException will be thrown.

See also getSubject().

  • Access: public

[ Top ]

getTitle   [line 184]

boolean|string getTitle( )

Retrieve title field or fields as a single string

Returns a string consisting of all title fields found in the XMP metadata. If more than one is present, they are joined by newlines. If there are no valid XMP metadata markers in the file, this function returns false.

If an unexpected condition occurs, such as failure to open the file or a file which is not a valid JPEG datastream, a Image_JpegMarkerReaderOpenException or Image_JpegMarkerReaderDamagedException will be thrown.

See also getTitles().

  • Access: public

[ Top ]

getTitles   [line 160]

boolean|array getTitles( )

Retrieve title fields

Returns an array consisting of all title fields found in the XMP metadata (most images only have one, so you may prefer to call getTitle()).

Returns false if no valid XMP metadata markers are present in the file.

If an unexpected condition occurs, such as failure to open the file or a file which is not a valid JPEG datastream, a Image_JpegMarkerReaderOpenException or Image_JpegMarkerReaderDamagedException will be thrown.

See also getTitle().

  • Access: public

[ Top ]

readXmp   [line 105]

boolean|SimpleXML readXmp( )

Read the next (typically the only) XMP metadata marker in the file

On success, returns a SimpleXML object. You don't have to call this function directly if you are not interested in accessing the XML directly. Just call getTitle(), getDescription(), and so on, which automatically call readXmp if it has not already been called at least once. Calling this function yourself is also a good way to check whether a valid XMP metadata marker is present in the file at all.

If no XMP data is present, returns false (0.5.1, matches the behavior expected by getField). If an unexpected condition occurs, such as failure to open the file or a file which is not a valid JPEG datastream, a Image_JpegMarkerReaderOpenException or Image_JpegMarkerReaderDamagedException will be thrown.

Warning: XMP loves namespaces. This function registers the relevant namespaces as an aid to making successful queries against the XMP object, but var_dump may not report anything if called on the XMP object. That's normal. Again, for an easier interface, use the various "get" functions in this class.

  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:41:49 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.