Method | Description | |
---|---|---|
__construct ( $type ) | Construct a new Image File Directory (IFD). | |
__toString ( ) : string | Turn this directory into text. | |
addEntry ( lsolesen\pel\PelEntry $e ) | Adds an entry to the directory. | |
addSubIfd ( |
Add a sub-IFD. | |
getBytes ( integer $offset, PelByteOrder $order ) | Turn this directory into bytes. | |
getEntries ( ) : array | Returns all entries contained in this IFD. | |
getEntry ( lsolesen\pel\PelTag $tag ) : lsolesen\pel\PelEntry | Retrieve an entry. | |
getIterator ( ) : Iterator | Return an iterator for all entries contained in this IFD. | |
getName ( ) : string | Get the name of this directory. | |
getNextIfd ( ) : |
Return the IFD pointed to by this directory. | |
getSubIfd ( integer $type ) : |
Return a sub IFD. | |
getSubIfds ( ) : array | Get all sub IFDs. | |
getThumbnailData ( ) : string | Returns available thumbnail data. | |
getType ( ) : integer | Get the type of this directory. | |
getTypeName ( integer $type ) : string | Get the name of an IFD type. | |
getValidTags ( ) : array | Returns a list of valid tags for this IFD. | |
isLastIfd ( ) : boolean | Check if this is the last IFD. | |
isValidTag ( lsolesen\pel\PelTag $tag ) : boolean | Is a given tag valid for this IFD? | |
load ( lsolesen\pel\PelDataWindow $d, integer $offset ) | Load data into a Image File Directory (IFD). | |
newEntryFromData ( lsolesen\pel\PelTag $tag, lsolesen\pel\PelFormat $format, integer $components, lsolesen\pel\PelDataWindow $data ) : lsolesen\pel\PelEntry | Make a new entry from a bunch of bytes. | |
offsetExists ( lsolesen\pel\PelTag $tag ) : boolean | Does a given tag exist in this IFD? | |
offsetGet ( lsolesen\pel\PelTag $tag ) : lsolesen\pel\PelEntry | Retrieve a given tag from this IFD. | |
offsetSet ( lsolesen\pel\PelTag $tag, lsolesen\pel\PelEntry $e ) | Set or update a given tag in this IFD. | |
offsetUnset ( lsolesen\pel\PelTag $tag ) | Unset a given tag in this IFD. | |
setNextIfd ( |
Make this directory point to a new directory. | |
setThumbnail ( lsolesen\pel\PelDataWindow $d ) | Set thumbnail data. |
Method | Description | |
---|---|---|
safeSetThumbnail ( lsolesen\pel\PelDataWindow $d, integer $offset, integer $length ) | Extract thumbnail data safely. |
public __construct ( $type ) |
public __toString ( ) : string | ||
return | string | information about the directory, mainly for debugging. |
public addEntry ( lsolesen\pel\PelEntry $e ) | ||
$e | lsolesen\pel\PelEntry | the entry that will be added. If the entry is not valid in this IFD (as per {@link isValidTag()}) an {@link PelInvalidDataException} is thrown. |
public addSubIfd ( |
||
$sub | the sub IFD. The type of must be one of {@link PelIfd::EXIF}, {@link PelIfd::GPS}, or {@link PelIfd::INTEROPERABILITY}. |
public getBytes ( integer $offset, PelByteOrder $order ) | ||
$offset | integer | the offset of the first byte of this directory. |
$order | PelByteOrder | the byte order that should be used when turning integers into bytes. This should be one of {@link PelConvert::LITTLE_ENDIAN} and {@link PelConvert::BIG_ENDIAN}. |
public getEntries ( ) : array | ||
return | array | an array of {@link PelEntry} objects, or rather descendant classes. The array has {@link PelTag}s as keys and the entries as values. |
public getEntry ( lsolesen\pel\PelTag $tag ) : lsolesen\pel\PelEntry | ||
$tag | lsolesen\pel\PelTag | the tag identifying the entry. |
return | lsolesen\pel\PelEntry | the entry associated with the tag, or null if no such entry exists. |
foreach ($ifd as $tag => $entry) {
$tag is now a PelTag and $entry is a PelEntry object.
}
public getIterator ( ) : Iterator | ||
return | Iterator | an iterator using the {@link PelTag tags} as keys and the entries as values. |
public getNextIfd ( ) : |
||
return | the next IFD, following this IFD. If this is the last IFD, null is returned. |
public getSubIfds ( ) : array | ||
return | array | an associative array with (IFD-type, {@link PelIfd}) pairs. |
public getThumbnailData ( ) : string | ||
return | string | the bytes in the thumbnail, if any. If the IFD does not contain any thumbnail data, the empty string is returned. |
public static getTypeName ( integer $type ) : string | ||
$type | integer | one of {@link PelIfd::IFD0}, {@link PelIfd::IFD1}, {@link PelIfd::EXIF}, {@link PelIfd::GPS}, or {@link PelIfd::INTEROPERABILITY}. |
return | string | the name of type. |
public getValidTags ( ) : array | ||
return | array | an array of {@link PelTag}s which are valid for this IFD. |
public isValidTag ( lsolesen\pel\PelTag $tag ) : boolean | ||
$tag | lsolesen\pel\PelTag | the tag. |
return | boolean | true if the tag is considered valid in this IFD, false otherwise. |
public newEntryFromData ( lsolesen\pel\PelTag $tag, lsolesen\pel\PelFormat $format, integer $components, lsolesen\pel\PelDataWindow $data ) : lsolesen\pel\PelEntry | ||
$tag | lsolesen\pel\PelTag | the tag of the entry. |
$format | lsolesen\pel\PelFormat | the format of the entry. |
$components | integer | the components in the entry. |
$data | lsolesen\pel\PelDataWindow | the data which will be used to construct the entry. |
return | lsolesen\pel\PelEntry | a newly created entry, holding the data given. |
if (isset($ifd[PelTag::FNUMBER]))
... do something with the F-number.
public offsetExists ( lsolesen\pel\PelTag $tag ) : boolean | ||
$tag | lsolesen\pel\PelTag | the offset to check. |
return | boolean | whether the tag exists. |
$entry = $ifd[PelTag::FNUMBER];
public offsetGet ( lsolesen\pel\PelTag $tag ) : lsolesen\pel\PelEntry | ||
$tag | lsolesen\pel\PelTag | the tag to return. It is an error to ask for a tag which is not in the IFD, just like asking for a non-existant array entry. |
return | lsolesen\pel\PelEntry | the entry. |
$ifd[PelTag::EXPOSURE_BIAS_VALUE] = $entry;
Note that the actual array index passed is ignored! Instead the
{@link PelTag} from the entry is used. public offsetSet ( lsolesen\pel\PelTag $tag, lsolesen\pel\PelEntry $e ) | ||
$tag | lsolesen\pel\PelTag | the offset to update. |
$e | lsolesen\pel\PelEntry | the new value. |
unset($ifd[PelTag::EXPOSURE_BIAS_VALUE])
public offsetUnset ( lsolesen\pel\PelTag $tag ) | ||
$tag | lsolesen\pel\PelTag | the offset to delete. |
public setNextIfd ( |
||
$i | the IFD that this directory will point to. |
public setThumbnail ( lsolesen\pel\PelDataWindow $d ) | ||
$d | lsolesen\pel\PelDataWindow | the thumbnail data. |