Class PelEntryLong

Description

Class for holding unsigned longs.

This class can hold longs, either just a single long or an array of longs. The class will be used to manipulate any of the Exif tags which can have format PelFormat::LONG 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/PelEntryLong.php (line 62)

PelEntry
   |
   --PelEntryNumber
      |
      --PelEntryLong
Direct descendents
Class Description
PelEntryRational Class for holding unsigned rational numbers.
Method Summary
PelEntryLong __construct (PelTag $tag, int $value...)
string numberToBytes (int $number, PelByteOrder $order)
Variables
Methods
Constructor __construct (line 94)

Make a new entry that can hold an unsigned long.

The method accept its arguments in two forms: several integer arguments or a single array argument. The getValue method will always return an array except for when a single integer argument is given here, or when an array with just a single integer is given.

This means that one can conveniently use objects like this:

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

PelEntryLong __construct (PelTag $tag, int $value...)
  • int $value...: the long(s) that this entry will represent or an array of longs. The argument passed must obey the same rules as the argument to setValue, namely that it should be within range of an unsigned long (32 bit), that is between 0 and 4294967295 (inclusive). If not, then a PelExifOverflowException 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, or any other tag which can have format PelFormat::LONG.

Redefined in descendants as:
numberToBytes (line 116)

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