xp-framework/xp-framework — pull request #216 by thekid (2012-12-28 14:17:29+00:00)
Title: Image metadata reader

This pull request adds an API for reading meta data from JPEG images and deprecates the `ExifData::fromFile()` and `IptcData::fromFile()` methods which don't work with streams.

Example usage:
```php
with ($reader= new MetaDataReader()); {
$meta= $reader->read($file->getInputStream(), $file->getURI());

$exif= $meta->exifData(); // img.util.ExifData
$iptc= $meta->iptcData(); // img.util.IptcData
}
```

Extended usage - raw EXIF data:
```php
with ($reader= new MetaDataReader()); {
$meta= $reader->read($file->getInputStream(), $file->getURI());

if ($segments= $meta->segmentsOf('img.io.ExifSegment)) {
Console::writeLine('EXIF: ', $segments[0]->rawData());
}
}
```

Extended usage - reading image comments:
```php
with ($reader= new MetaDataReader()); {
$meta= $reader->read($file->getInputStream(), $file->getURI());

if ($segments= $meta->segmentsOf('img.io.CommentSegment')) {
Console::writeLine('Image comment: ', $segments[0]->text());
}
}
```