Class PelEntryShort

Description

Class for holding signed shorts.

This class can hold shorts, either just a single short or an array of shorts. The class will be used to manipulate any of the Exif tags which has format PelFormat::SHORT like in this example:

  1.  $w $ifd->getEntry(PelTag::EXIF_IMAGE_WIDTH);
  2.  $w->setValue($w->getValue(2);
  3.  $h $ifd->getEntry(PelTag::EXIF_IMAGE_HEIGHT);
  4.  $h->setValue($h->getValue(2);

Here the width and height is updated to 50% of their original values.

Located in /src/PelEntryShort.php (line 66)

PelEntry
   |
   --PelEntryNumber
      |
      --PelEntryShort
Method Summary
PelEntryShort __construct (PelTag $tag, int $value...)
string getText ([boolean $brief = false])
string numberToBytes (int $number, PelByteOrder $order)
Variables
Methods
Constructor __construct (line 96)

Make a new entry that can hold an unsigned short.

The method accept several integer arguments. The getValue method will always return an array except for when a single integer argument is given here.

This means that one can conveniently use objects like this:

  1.  $a new PelEntryShort(PelTag::EXIF_IMAGE_HEIGHT42);
  2.  $b $a->getValue(314;
where the call to getValue will return an integer instead of an array with one integer element, which would then have to be extracted.

PelEntryShort __construct (PelTag $tag, int $value...)
  • int $value...: the short(s) that this entry will represent. The argument passed must obey the same rules as the argument to setValue, namely that it should be within range of an unsigned short, that is between 0 and 65535 (inclusive). If not, then a PelOverFlowException will be thrown.
  • PelTag $tag: the tag which this entry represents. This should be one of the constants defined in PelTag, e.g., PelTag::IMAGE_WIDTH, PelTag::ISO_SPEED_RATINGS, or any other tag with format PelFormat::SHORT.
getText (line 136)

Get the value of an entry as text.

The value will be returned in a format suitable for presentation, e.g., instead of returning '2' for a PelTag::METERING_MODE tag, 'Center-Weighted Average' is returned.

  • return: the value as text.
string getText ([boolean $brief = false])
  • boolean $brief: some values can be returned in a long or more brief form, and this parameter controls that.

Redefinition of:
PelEntryNumber::getText()
Get the numeric value of this entry as text.
numberToBytes (line 118)

Convert a number into bytes.

  • return: bytes representing the number given.
string numberToBytes (int $number, PelByteOrder $order)

Redefinition of:
PelEntryNumber::numberToBytes()
Convert a number into bytes.

Inherited Methods

Inherited From PelEntryNumber

PelEntryNumber::addNumber()
PelEntryNumber::formatNumber()
PelEntryNumber::getBytes()
PelEntryNumber::getText()
PelEntryNumber::getValue()
PelEntryNumber::numberToBytes()
PelEntryNumber::setValue()
PelEntryNumber::setValueArray()
PelEntryNumber::validateNumber()

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:08 +0200 by phpDocumentor 1.4.3