Class PelEntryUserComment

Description

Class for a user comment.

This class is used to hold user comments, which can come in several different character encodings. The Exif standard specifies a certain format of the user comment tag, and this class will make sure that the format is kept.

The most basic use of this class simply stores an ASCII encoded string for later retrieval using getValue:

  1.  $entry new PelEntryUserComment('An ASCII string');
  2.  echo $entry->getValue();

The string can be encoded with a different encoding, and if so, the encoding must be given using the second argument. The Exif standard specifies three known encodings: 'ASCII', 'JIS', and 'Unicode'. If the user comment is encoded using a character encoding different from the tree known encodings, then the empty string should be passed as encoding, thereby specifying that the encoding is undefined.

Located in /src/PelEntryUndefined.php (line 203)

PelEntry
   |
   --PelEntryUndefined
      |
      --PelEntryUserComment
Method Summary
PelEntryUserComment __construct ([string $comment = ''], [string $encoding = 'ASCII'])
string getEncoding ()
string getText ([ $brief = false])
string getValue ()
void setValue ([string $comment = ''], [string $encoding = 'ASCII'])
Variables
Methods
Constructor __construct (line 230)

Make a new entry for holding a user comment.

PelEntryUserComment __construct ([string $comment = ''], [string $encoding = 'ASCII'])
  • string $comment: the new user comment.
  • string $encoding: the encoding of the comment. This should be either 'ASCII', 'JIS', 'Unicode', or the empty string specifying an undefined encoding.

Redefinition of:
PelEntryUndefined::__construct()
Make a new PelEntry that can hold undefined data.
getEncoding (line 271)

Returns the encoding.

  • return: the encoding of the user comment.
string getEncoding ()
getText (line 281)

Returns the user comment.

  • return: the user comment.
string getText ([ $brief = false])
  • $brief

Redefinition of:
PelEntryUndefined::getText()
Get the value of this entry as text.
getValue (line 261)

Returns the user comment.

The comment is returned with the same character encoding as when it was set using setValue or the constructor.

  • return: the user comment.
string getValue ()

Redefinition of:
PelEntryUndefined::getValue()
Get the data of this undefined entry.
setValue (line 245)

Set the user comment.

void setValue ([string $comment = ''], [string $encoding = 'ASCII'])
  • string $comment: the new user comment.
  • string $encoding: the encoding of the comment. This should be either 'ASCII', 'JIS', 'Unicode', or the empty string specifying an unknown encoding.

Redefinition of:
PelEntryUndefined::setValue()
Set the data of this undefined entry.

Inherited Methods

Inherited From PelEntryUndefined

PelEntryUndefined::__construct()
PelEntryUndefined::getText()
PelEntryUndefined::getValue()
PelEntryUndefined::setValue()

Inherited From PelEntry

PelEntry::getBytes()
PelEntry::getComponents()
PelEntry::getFormat()
PelEntry::getIfdType()
PelEntry::getTag()
PelEntry::getText()
PelEntry::getValue()
PelEntry::setIfdType()
PelEntry::setValue()
PelEntry::__toString()

Documentation generated on Thu, 05 May 2011 07:19:10 +0200 by phpDocumentor 1.4.3