本文整理汇总了PHP中Pel::getExceptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Pel::getExceptions方法的具体用法?PHP Pel::getExceptions怎么用?PHP Pel::getExceptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pel
的用法示例。
在下文中一共展示了Pel::getExceptions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRead
function testRead()
{
Pel::clearExceptions();
Pel::setStrictParsing(false);
$jpeg = new PelJpeg(dirname(__FILE__) . '/no-exif.jpg');
$exif = $jpeg->getExif();
$this->assertNull($exif);
$this->assertTrue(count(Pel::getExceptions()) == 0);
}
示例2: exit
print "Mandatory arguments:\n";
print " filename a JPEG or TIFF image.\n";
exit(1);
}
if (!is_readable($file)) {
printf("Unable to read %s!\n", $file);
exit(1);
}
/* We typically need lots of RAM to parse TIFF images since they tend
* to be big and uncompressed. */
ini_set('memory_limit', '32M');
$data = new PelDataWindow(file_get_contents($file));
if (PelJpeg::isValid($data)) {
$img = new PelJpeg();
} elseif (PelTiff::isValid($data)) {
$img = new PelTiff();
} else {
print "Unrecognized image format! The first 16 bytes follow:\n";
PelConvert::bytesToDump($data->getBytes(0, 16));
exit(1);
}
/* Try loading the data. */
$img->load($data);
print $img;
/* Deal with any exceptions: */
if (count(Pel::getExceptions()) > 0) {
print "\nThe following errors were encountered while loading the image:\n";
foreach (Pel::getExceptions() as $e) {
print "\n" . $e->__toString();
}
}
示例3: testRead
//.........这里部分代码省略.........
/* Start of IDF $ifd0. */
$this->assertEqual(count($ifd0->getEntries()), 6);
$entry = $ifd0->getEntry(271);
// Make
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'Nikon');
$this->assertEqual($entry->getText(), 'Nikon');
$entry = $ifd0->getEntry(282);
// XResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 2000, 1 => 1));
$this->assertEqual($entry->getText(), '2000/1');
$entry = $ifd0->getEntry(283);
// YResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 2000, 1 => 1));
$this->assertEqual($entry->getText(), '2000/1');
$entry = $ifd0->getEntry(296);
// ResolutionUnit
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Inch');
$entry = $ifd0->getEntry(306);
// DateTime
$this->assertIsA($entry, 'PelEntryTime');
$this->assertEqual($entry->getValue(), 1090023875);
$this->assertEqual($entry->getText(), '2004:07:17 00:24:35');
$entry = $ifd0->getEntry(531);
// YCbCrPositioning
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 1);
$this->assertEqual($entry->getText(), 'centered');
/* Sub IFDs of $ifd0. */
$this->assertEqual(count($ifd0->getSubIfds()), 2);
$ifd0_0 = $ifd0->getSubIfd(2);
// IFD Exif
$this->assertIsA($ifd0_0, 'PelIfd');
/* Start of IDF $ifd0_0. */
$this->assertEqual(count($ifd0_0->getEntries()), 7);
$entry = $ifd0_0->getEntry(36864);
// ExifVersion
$this->assertIsA($entry, 'PelEntryVersion');
$this->assertEqual($entry->getValue(), 2.1);
$this->assertEqual($entry->getText(), 'Exif Version 2.1');
$entry = $ifd0_0->getEntry(37121);
// ComponentsConfiguration
$this->assertIsA($entry, 'PelEntryUndefined');
$this->assertEqual($entry->getValue(), '' . "" . '');
$this->assertEqual($entry->getText(), 'Y Cb Cr -');
$entry = $ifd0_0->getEntry(37500);
// MakerNote
$this->assertIsA($entry, 'PelEntryUndefined');
$this->assertEqual($entry->getValue(), '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '0100' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '');
$this->assertEqual($entry->getText(), '32 bytes unknown MakerNote data');
$entry = $ifd0_0->getEntry(40960);
// FlashPixVersion
$this->assertIsA($entry, 'PelEntryVersion');
$this->assertEqual($entry->getValue(), 1);
$this->assertEqual($entry->getText(), 'FlashPix Version 1.0');
$entry = $ifd0_0->getEntry(40961);
// ColorSpace
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 1);
$this->assertEqual($entry->getText(), 'sRGB');
$entry = $ifd0_0->getEntry(40962);
// PixelXDimension
$this->assertIsA($entry, 'PelEntryLong');
$this->assertEqual($entry->getValue(), 960);
$this->assertEqual($entry->getText(), '960');
$entry = $ifd0_0->getEntry(40963);
// PixelYDimension
$this->assertIsA($entry, 'PelEntryLong');
$this->assertEqual($entry->getValue(), 755);
$this->assertEqual($entry->getText(), '755');
/* Sub IFDs of $ifd0_0. */
$this->assertEqual(count($ifd0_0->getSubIfds()), 0);
$this->assertEqual($ifd0_0->getThumbnailData(), '');
/* Next IFD. */
$ifd0_1 = $ifd0_0->getNextIfd();
$this->assertNull($ifd0_1);
/* End of IFD $ifd0_0. */
$ifd0_1 = $ifd0->getSubIfd(3);
// IFD GPS
$this->assertIsA($ifd0_1, 'PelIfd');
/* Start of IDF $ifd0_1. */
$this->assertEqual(count($ifd0_1->getEntries()), 0);
/* Sub IFDs of $ifd0_1. */
$this->assertEqual(count($ifd0_1->getSubIfds()), 0);
$this->assertEqual($ifd0_1->getThumbnailData(), '');
/* Next IFD. */
$ifd0_2 = $ifd0_1->getNextIfd();
$this->assertNull($ifd0_2);
/* End of IFD $ifd0_1. */
$this->assertEqual($ifd0->getThumbnailData(), '');
/* Next IFD. */
$ifd1 = $ifd0->getNextIfd();
$this->assertNull($ifd1);
/* End of IFD $ifd0. */
$this->assertTrue(count(Pel::getExceptions()) == 0);
}
示例4: testRead
//.........这里部分代码省略.........
$entry = $ifd0_0->getEntry(41990);
// SceneCaptureType
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 0);
$this->assertEqual($entry->getText(), 'Standard');
$entry = $ifd0_0->getEntry(41991);
// GainControl
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 0);
$this->assertEqual($entry->getText(), 'Normal');
$entry = $ifd0_0->getEntry(41992);
// Contrast
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 0);
$this->assertEqual($entry->getText(), 'Normal');
$entry = $ifd0_0->getEntry(41993);
// Saturation
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 0);
$this->assertEqual($entry->getText(), 'Normal');
$entry = $ifd0_0->getEntry(41994);
// Sharpness
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 0);
$this->assertEqual($entry->getText(), 'Normal');
$entry = $ifd0_0->getEntry(41996);
// SubjectDistanceRange
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Close view');
/* Sub IFDs of $ifd0_0. */
$this->assertEqual(count($ifd0_0->getSubIfds()), 1);
$ifd0_0_0 = $ifd0_0->getSubIfd(4);
// IFD Interoperability
$this->assertIsA($ifd0_0_0, 'PelIfd');
/* Start of IDF $ifd0_0_0. */
$this->assertEqual(count($ifd0_0_0->getEntries()), 2);
$entry = $ifd0_0_0->getEntry(1);
// InteroperabilityIndex
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'R98');
$this->assertEqual($entry->getText(), 'R98');
$entry = $ifd0_0_0->getEntry(2);
// InteroperabilityVersion
$this->assertIsA($entry, 'PelEntryVersion');
$this->assertEqual($entry->getValue(), 1);
$this->assertEqual($entry->getText(), 'Interoperability Version 1.0');
/* Sub IFDs of $ifd0_0_0. */
$this->assertEqual(count($ifd0_0_0->getSubIfds()), 0);
$this->assertEqual($ifd0_0_0->getThumbnailData(), '');
/* Next IFD. */
$ifd0_0_1 = $ifd0_0_0->getNextIfd();
$this->assertNull($ifd0_0_1);
/* End of IFD $ifd0_0_0. */
$this->assertEqual($ifd0_0->getThumbnailData(), '');
/* Next IFD. */
$ifd0_1 = $ifd0_0->getNextIfd();
$this->assertNull($ifd0_1);
/* End of IFD $ifd0_0. */
$this->assertEqual($ifd0->getThumbnailData(), '');
/* Next IFD. */
$ifd1 = $ifd0->getNextIfd();
$this->assertIsA($ifd1, 'PelIfd');
/* End of IFD $ifd0. */
/* Start of IDF $ifd1. */
$this->assertEqual(count($ifd1->getEntries()), 5);
$entry = $ifd1->getEntry(259);
// Compression
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 6);
$this->assertEqual($entry->getText(), 'JPEG compression');
$entry = $ifd1->getEntry(282);
// XResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 72, 1 => 1));
$this->assertEqual($entry->getText(), '72/1');
$entry = $ifd1->getEntry(283);
// YResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 72, 1 => 1));
$this->assertEqual($entry->getText(), '72/1');
$entry = $ifd1->getEntry(296);
// ResolutionUnit
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Inch');
$entry = $ifd1->getEntry(531);
// YCbCrPositioning
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'co-sited');
/* Sub IFDs of $ifd1. */
$this->assertEqual(count($ifd1->getSubIfds()), 0);
$thumb_data = file_get_contents(dirname(__FILE__) . '/leica-d-lux-thumb.jpg');
$this->assertEqual($ifd1->getThumbnailData(), $thumb_data);
/* Next IFD. */
$ifd2 = $ifd1->getNextIfd();
$this->assertNull($ifd2);
/* End of IFD $ifd1. */
$this->assertTrue(count(Pel::getExceptions()) == 0);
示例5: testRead
//.........这里部分代码省略.........
$entry = $ifd0_0->getEntry(41985);
// CustomRendered
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 0);
$this->assertEqual($entry->getText(), 'Normal process');
$entry = $ifd0_0->getEntry(41986);
// ExposureMode
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 0);
$this->assertEqual($entry->getText(), 'Auto exposure');
$entry = $ifd0_0->getEntry(41987);
// WhiteBalance
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 0);
$this->assertEqual($entry->getText(), 'Auto white balance');
$entry = $ifd0_0->getEntry(41988);
// DigitalZoomRatio
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 2592, 1 => 2592));
$this->assertEqual($entry->getText(), '2592/2592');
$entry = $ifd0_0->getEntry(41990);
// SceneCaptureType
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 0);
$this->assertEqual($entry->getText(), 'Standard');
/* Sub IFDs of $ifd0_0. */
$this->assertEqual(count($ifd0_0->getSubIfds()), 1);
$ifd0_0_0 = $ifd0_0->getSubIfd(4);
// IFD Interoperability
$this->assertIsA($ifd0_0_0, 'PelIfd');
/* Start of IDF $ifd0_0_0. */
$this->assertEqual(count($ifd0_0_0->getEntries()), 4);
$entry = $ifd0_0_0->getEntry(1);
// InteroperabilityIndex
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'R98');
$this->assertEqual($entry->getText(), 'R98');
$entry = $ifd0_0_0->getEntry(2);
// InteroperabilityVersion
$this->assertIsA($entry, 'PelEntryVersion');
$this->assertEqual($entry->getValue(), 1);
$this->assertEqual($entry->getText(), 'Interoperability Version 1.0');
$entry = $ifd0_0_0->getEntry(4097);
// RelatedImageWidth
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 640);
$this->assertEqual($entry->getText(), '640');
$entry = $ifd0_0_0->getEntry(4098);
// RelatedImageLength
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 480);
$this->assertEqual($entry->getText(), '480');
/* Sub IFDs of $ifd0_0_0. */
$this->assertEqual(count($ifd0_0_0->getSubIfds()), 0);
$this->assertEqual($ifd0_0_0->getThumbnailData(), '');
/* Next IFD. */
$ifd0_0_1 = $ifd0_0_0->getNextIfd();
$this->assertNull($ifd0_0_1);
/* End of IFD $ifd0_0_0. */
$this->assertEqual($ifd0_0->getThumbnailData(), '');
/* Next IFD. */
$ifd0_1 = $ifd0_0->getNextIfd();
$this->assertNull($ifd0_1);
/* End of IFD $ifd0_0. */
$this->assertEqual($ifd0->getThumbnailData(), '');
/* Next IFD. */
$ifd1 = $ifd0->getNextIfd();
$this->assertIsA($ifd1, 'PelIfd');
/* End of IFD $ifd0. */
/* Start of IDF $ifd1. */
$this->assertEqual(count($ifd1->getEntries()), 4);
$entry = $ifd1->getEntry(259);
// Compression
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 6);
$this->assertEqual($entry->getText(), 'JPEG compression');
$entry = $ifd1->getEntry(282);
// XResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 180, 1 => 1));
$this->assertEqual($entry->getText(), '180/1');
$entry = $ifd1->getEntry(283);
// YResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 180, 1 => 1));
$this->assertEqual($entry->getText(), '180/1');
$entry = $ifd1->getEntry(296);
// ResolutionUnit
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Inch');
/* Sub IFDs of $ifd1. */
$this->assertEqual(count($ifd1->getSubIfds()), 0);
$thumb_data = file_get_contents(dirname(__FILE__) . '/canon-powershot-s60-thumb.jpg');
$this->assertEqual($ifd1->getThumbnailData(), $thumb_data);
/* Next IFD. */
$ifd2 = $ifd1->getNextIfd();
$this->assertNull($ifd2);
/* End of IFD $ifd1. */
$this->assertTrue(count(Pel::getExceptions()) == 0);
示例6: testRead
//.........这里部分代码省略.........
// UserComment
$this->assertIsA($entry, 'PelEntryUserComment');
$this->assertEqual($entry->getValue(), ' ');
$this->assertEqual($entry->getText(), ' ');
$entry = $ifd0_0->getEntry(40960);
// FlashPixVersion
$this->assertIsA($entry, 'PelEntryVersion');
$this->assertEqual($entry->getValue(), 1);
$this->assertEqual($entry->getText(), 'FlashPix Version 1.0');
$entry = $ifd0_0->getEntry(40961);
// ColorSpace
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 1);
$this->assertEqual($entry->getText(), 'sRGB');
$entry = $ifd0_0->getEntry(40962);
// PixelXDimension
$this->assertIsA($entry, 'PelEntryLong');
$this->assertEqual($entry->getValue(), 1600);
$this->assertEqual($entry->getText(), '1600');
$entry = $ifd0_0->getEntry(40963);
// PixelYDimension
$this->assertIsA($entry, 'PelEntryLong');
$this->assertEqual($entry->getValue(), 1200);
$this->assertEqual($entry->getText(), '1200');
$entry = $ifd0_0->getEntry(41728);
// FileSource
$this->assertIsA($entry, 'PelEntryUndefined');
$this->assertEqual($entry->getValue(), '');
$this->assertEqual($entry->getText(), 'DSC');
$entry = $ifd0_0->getEntry(41729);
// SceneType
$this->assertIsA($entry, 'PelEntryUndefined');
$this->assertEqual($entry->getValue(), '');
$this->assertEqual($entry->getText(), 'Directly photographed');
/* Sub IFDs of $ifd0_0. */
$this->assertEqual(count($ifd0_0->getSubIfds()), 1);
$ifd0_0_0 = $ifd0_0->getSubIfd(4);
// IFD Interoperability
$this->assertIsA($ifd0_0_0, 'PelIfd');
/* Start of IDF $ifd0_0_0. */
$this->assertEqual(count($ifd0_0_0->getEntries()), 2);
$entry = $ifd0_0_0->getEntry(1);
// InteroperabilityIndex
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'R98');
$this->assertEqual($entry->getText(), 'R98');
$entry = $ifd0_0_0->getEntry(2);
// InteroperabilityVersion
$this->assertIsA($entry, 'PelEntryVersion');
$this->assertEqual($entry->getValue(), 1);
$this->assertEqual($entry->getText(), 'Interoperability Version 1.0');
/* Sub IFDs of $ifd0_0_0. */
$this->assertEqual(count($ifd0_0_0->getSubIfds()), 0);
$this->assertEqual($ifd0_0_0->getThumbnailData(), '');
/* Next IFD. */
$ifd0_0_1 = $ifd0_0_0->getNextIfd();
$this->assertNull($ifd0_0_1);
/* End of IFD $ifd0_0_0. */
$this->assertEqual($ifd0_0->getThumbnailData(), '');
/* Next IFD. */
$ifd0_1 = $ifd0_0->getNextIfd();
$this->assertNull($ifd0_1);
/* End of IFD $ifd0_0. */
$this->assertEqual($ifd0->getThumbnailData(), '');
/* Next IFD. */
$ifd1 = $ifd0->getNextIfd();
$this->assertIsA($ifd1, 'PelIfd');
/* End of IFD $ifd0. */
/* Start of IDF $ifd1. */
$this->assertEqual(count($ifd1->getEntries()), 4);
$entry = $ifd1->getEntry(259);
// Compression
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 6);
$this->assertEqual($entry->getText(), 'JPEG compression');
$entry = $ifd1->getEntry(282);
// XResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 300, 1 => 1));
$this->assertEqual($entry->getText(), '300/1');
$entry = $ifd1->getEntry(283);
// YResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 300, 1 => 1));
$this->assertEqual($entry->getText(), '300/1');
$entry = $ifd1->getEntry(296);
// ResolutionUnit
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Inch');
/* Sub IFDs of $ifd1. */
$this->assertEqual(count($ifd1->getSubIfds()), 0);
$thumb_data = file_get_contents(dirname(__FILE__) . '/nikon-e950-thumb.jpg');
$this->assertEqual($ifd1->getThumbnailData(), $thumb_data);
/* Next IFD. */
$ifd2 = $ifd1->getNextIfd();
$this->assertNull($ifd2);
/* End of IFD $ifd1. */
$this->assertTrue(count(Pel::getExceptions()) == 0);
}
示例7: __construct
function __construct() {
require_once(dirname(__FILE__) . \'/../../src/PelJpeg.php\');
parent::__construct(\'PEL %s Tests\');
}
function testRead() {
Pel::clearExceptions();
Pel::setStrictParsing(false);
$jpeg = new PelJpeg(dirname(__FILE__) . \'/%s\');
', $test_name, $image_filename, $image_filename);
require_once dirname(__FILE__) . '/../../src/PelJpeg.php';
$jpeg = new PelJpeg($image_filename);
$indent = 2;
jpegToTest('$jpeg', $jpeg);
println();
$exceptions = Pel::getExceptions();
if (count($exceptions) == 0) {
println('$this->assertTrue(count(Pel::getExceptions()) == 0);');
} else {
println('$exceptions = Pel::getExceptions();');
for ($i = 0; $i < count($exceptions); $i++) {
println('$this->assertIsA($exceptions[%d], \'%s\');', $i, get_class($exceptions[$i]));
println('$this->assertEqual($exceptions[%d]->getMessage(),', $i);
println(' \'%s\');', quote($exceptions[$i]->getMessage()));
}
}
println('
}
}
');
/* The test case is finished -- now dump the output as a PHP file. */
示例8: testRead
//.........这里部分代码省略.........
$entry = $ifd0_0->getEntry(41985);
// CustomRendered
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 0);
$this->assertEqual($entry->getText(), 'Normal process');
$entry = $ifd0_0->getEntry(41986);
// ExposureMode
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 1);
$this->assertEqual($entry->getText(), 'Manual exposure');
$entry = $ifd0_0->getEntry(41987);
// WhiteBalance
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 1);
$this->assertEqual($entry->getText(), 'Manual white balance');
$entry = $ifd0_0->getEntry(41988);
// DigitalZoomRatio
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 2048, 1 => 2048));
$this->assertEqual($entry->getText(), '2048/2048');
$entry = $ifd0_0->getEntry(41990);
// SceneCaptureType
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 0);
$this->assertEqual($entry->getText(), 'Standard');
/* Sub IFDs of $ifd0_0. */
$this->assertEqual(count($ifd0_0->getSubIfds()), 1);
$ifd0_0_0 = $ifd0_0->getSubIfd(4);
// IFD Interoperability
$this->assertIsA($ifd0_0_0, 'PelIfd');
/* Start of IDF $ifd0_0_0. */
$this->assertEqual(count($ifd0_0_0->getEntries()), 4);
$entry = $ifd0_0_0->getEntry(1);
// InteroperabilityIndex
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'R98');
$this->assertEqual($entry->getText(), 'R98');
$entry = $ifd0_0_0->getEntry(2);
// InteroperabilityVersion
$this->assertIsA($entry, 'PelEntryVersion');
$this->assertEqual($entry->getValue(), 1);
$this->assertEqual($entry->getText(), 'Interoperability Version 1.0');
$entry = $ifd0_0_0->getEntry(4097);
// RelatedImageWidth
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 640);
$this->assertEqual($entry->getText(), '640');
$entry = $ifd0_0_0->getEntry(4098);
// RelatedImageLength
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 480);
$this->assertEqual($entry->getText(), '480');
/* Sub IFDs of $ifd0_0_0. */
$this->assertEqual(count($ifd0_0_0->getSubIfds()), 0);
$this->assertEqual($ifd0_0_0->getThumbnailData(), '');
/* Next IFD. */
$ifd0_0_1 = $ifd0_0_0->getNextIfd();
$this->assertNull($ifd0_0_1);
/* End of IFD $ifd0_0_0. */
$this->assertEqual($ifd0_0->getThumbnailData(), '');
/* Next IFD. */
$ifd0_1 = $ifd0_0->getNextIfd();
$this->assertNull($ifd0_1);
/* End of IFD $ifd0_0. */
$this->assertEqual($ifd0->getThumbnailData(), '');
/* Next IFD. */
$ifd1 = $ifd0->getNextIfd();
$this->assertIsA($ifd1, 'PelIfd');
/* End of IFD $ifd0. */
/* Start of IDF $ifd1. */
$this->assertEqual(count($ifd1->getEntries()), 4);
$entry = $ifd1->getEntry(259);
// Compression
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 6);
$this->assertEqual($entry->getText(), 'JPEG compression');
$entry = $ifd1->getEntry(282);
// XResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 180, 1 => 1));
$this->assertEqual($entry->getText(), '180/1');
$entry = $ifd1->getEntry(283);
// YResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 180, 1 => 1));
$this->assertEqual($entry->getText(), '180/1');
$entry = $ifd1->getEntry(296);
// ResolutionUnit
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Inch');
/* Sub IFDs of $ifd1. */
$this->assertEqual(count($ifd1->getSubIfds()), 0);
$thumb_data = file_get_contents(dirname(__FILE__) . '/canon-ixus-ii-thumb.jpg');
$this->assertEqual($ifd1->getThumbnailData(), $thumb_data);
/* Next IFD. */
$ifd2 = $ifd1->getNextIfd();
$this->assertNull($ifd2);
/* End of IFD $ifd1. */
$this->assertTrue(count(Pel::getExceptions()) == 0);
示例9: testRead
function testRead()
{
Pel::clearExceptions();
Pel::setStrictParsing(false);
$jpeg = new PelJpeg(dirname(__FILE__) . '/olympus-c5050z.jpg');
$exif = $jpeg->getExif();
$this->assertIsA($exif, 'PelExif');
$tiff = $exif->getTiff();
$this->assertIsA($tiff, 'PelTiff');
/* The first IFD. */
$ifd0 = $tiff->getIfd();
$this->assertIsA($ifd0, 'PelIfd');
/* Start of IDF $ifd0. */
$this->assertEqual(count($ifd0->getEntries()), 11);
$entry = $ifd0->getEntry(270);
// ImageDescription
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'OLYMPUS DIGITAL CAMERA ');
$this->assertEqual($entry->getText(), 'OLYMPUS DIGITAL CAMERA ');
$entry = $ifd0->getEntry(271);
// Make
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'OLYMPUS OPTICAL CO.,LTD');
$this->assertEqual($entry->getText(), 'OLYMPUS OPTICAL CO.,LTD');
$entry = $ifd0->getEntry(272);
// Model
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'C5050Z');
$this->assertEqual($entry->getText(), 'C5050Z');
$entry = $ifd0->getEntry(274);
// Orientation
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 1);
$this->assertEqual($entry->getText(), 'top - left');
$entry = $ifd0->getEntry(282);
// XResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 72, 1 => 1));
$this->assertEqual($entry->getText(), '72/1');
$entry = $ifd0->getEntry(283);
// YResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 72, 1 => 1));
$this->assertEqual($entry->getText(), '72/1');
$entry = $ifd0->getEntry(296);
// ResolutionUnit
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Inch');
$entry = $ifd0->getEntry(305);
// Software
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'v558-83');
$this->assertEqual($entry->getText(), 'v558-83');
$entry = $ifd0->getEntry(306);
// DateTime
$this->assertIsA($entry, 'PelEntryTime');
$this->assertEqual($entry->getValue(), false);
$this->assertEqual($entry->getText(), '0000:00:00 00:00:00');
$entry = $ifd0->getEntry(531);
// YCbCrPositioning
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'co-sited');
$entry = $ifd0->getEntry(50341);
// PrintIM
$this->assertIsA($entry, 'PelEntryUndefined');
$this->assertEqual($entry->getValue(), 'PrintIM0250�
�
����������� \'\'�\'�\'\'^\'�\'�\'�\'');
$this->assertEqual($entry->getText(), '(undefined)');
/* Sub IFDs of $ifd0. */
$this->assertEqual(count($ifd0->getSubIfds()), 1);
$ifd0_0 = $ifd0->getSubIfd(2);
// IFD Exif
$this->assertIsA($ifd0_0, 'PelIfd');
/* Start of IDF $ifd0_0. */
$this->assertEqual(count($ifd0_0->getEntries()), 32);
$entry = $ifd0_0->getEntry(33434);
// ExposureTime
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 10, 1 => 40));
$this->assertEqual($entry->getText(), '1/4 sec.');
$entry = $ifd0_0->getEntry(33437);
// FNumber
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 26, 1 => 10));
$this->assertEqual($entry->getText(), 'f/2.6');
$entry = $ifd0_0->getEntry(34850);
// ExposureProgram
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Normal program');
$entry = $ifd0_0->getEntry(34855);
// ISOSpeedRatings
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 64);
$this->assertEqual($entry->getText(), '64');
$entry = $ifd0_0->getEntry(36864);
// ExifVersion
//.........这里部分代码省略.........
示例10: testRead
function testRead()
{
Pel::clearExceptions();
Pel::setStrictParsing(false);
$jpeg = new PelJpeg(dirname(__FILE__) . '/olympus-c50z.jpg');
$exif = $jpeg->getExif();
$this->assertIsA($exif, 'PelExif');
$tiff = $exif->getTiff();
$this->assertIsA($tiff, 'PelTiff');
/* The first IFD. */
$ifd0 = $tiff->getIfd();
$this->assertIsA($ifd0, 'PelIfd');
/* Start of IDF $ifd0. */
$this->assertEqual(count($ifd0->getEntries()), 11);
$entry = $ifd0->getEntry(270);
// ImageDescription
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'OLYMPUS DIGITAL CAMERA ');
$this->assertEqual($entry->getText(), 'OLYMPUS DIGITAL CAMERA ');
$entry = $ifd0->getEntry(271);
// Make
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'OLYMPUS OPTICAL CO.,LTD');
$this->assertEqual($entry->getText(), 'OLYMPUS OPTICAL CO.,LTD');
$entry = $ifd0->getEntry(272);
// Model
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'X-2,C-50Z ');
$this->assertEqual($entry->getText(), 'X-2,C-50Z ');
$entry = $ifd0->getEntry(274);
// Orientation
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 1);
$this->assertEqual($entry->getText(), 'top - left');
$entry = $ifd0->getEntry(282);
// XResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 144, 1 => 1));
$this->assertEqual($entry->getText(), '144/1');
$entry = $ifd0->getEntry(283);
// YResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 144, 1 => 1));
$this->assertEqual($entry->getText(), '144/1');
$entry = $ifd0->getEntry(296);
// ResolutionUnit
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Inch');
$entry = $ifd0->getEntry(305);
// Software
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), '28-1012 ');
$this->assertEqual($entry->getText(), '28-1012 ');
$entry = $ifd0->getEntry(306);
// DateTime
$this->assertIsA($entry, 'PelEntryTime');
$this->assertEqual($entry->getValue(), false);
$this->assertEqual($entry->getText(), '0000:00:00 00:00:00');
$entry = $ifd0->getEntry(531);
// YCbCrPositioning
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'co-sited');
$entry = $ifd0->getEntry(50341);
// PrintIM
$this->assertIsA($entry, 'PelEntryUndefined');
$this->assertEqual($entry->getValue(), 'PrintIM0250ˆ
Ð
èÿ€€€€€€€€€ \'\'—\'°\'\'^\'‹\'Ë\'å\'');
$this->assertEqual($entry->getText(), '(undefined)');
/* Sub IFDs of $ifd0. */
$this->assertEqual(count($ifd0->getSubIfds()), 1);
$ifd0_0 = $ifd0->getSubIfd(2);
// IFD Exif
$this->assertIsA($ifd0_0, 'PelIfd');
/* Start of IDF $ifd0_0. */
$this->assertEqual(count($ifd0_0->getEntries()), 30);
$entry = $ifd0_0->getEntry(33434);
// ExposureTime
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 1, 1 => 80));
$this->assertEqual($entry->getText(), '1/80 sec.');
$entry = $ifd0_0->getEntry(33437);
// FNumber
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 45, 1 => 10));
$this->assertEqual($entry->getText(), 'f/4.5');
$entry = $ifd0_0->getEntry(34850);
// ExposureProgram
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 5);
$this->assertEqual($entry->getText(), 'Creative program (biased toward depth of field)');
$entry = $ifd0_0->getEntry(34855);
// ISOSpeedRatings
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 80);
$this->assertEqual($entry->getText(), '80');
$entry = $ifd0_0->getEntry(36864);
// ExifVersion
//.........这里部分代码省略.........
示例11: testRead
function testRead()
{
Pel::clearExceptions();
Pel::setStrictParsing(false);
$jpeg = new PelJpeg(dirname(__FILE__) . '/sony-dsc-v1.jpg');
$exif = $jpeg->getExif();
$this->assertIsA($exif, 'PelExif');
$tiff = $exif->getTiff();
$this->assertIsA($tiff, 'PelTiff');
/* The first IFD. */
$ifd0 = $tiff->getIfd();
$this->assertIsA($ifd0, 'PelIfd');
/* Start of IDF $ifd0. */
$this->assertEqual(count($ifd0->getEntries()), 10);
$entry = $ifd0->getEntry(270);
// ImageDescription
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), ' ');
$this->assertEqual($entry->getText(), ' ');
$entry = $ifd0->getEntry(271);
// Make
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'SONY');
$this->assertEqual($entry->getText(), 'SONY');
$entry = $ifd0->getEntry(272);
// Model
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'DSC-V1');
$this->assertEqual($entry->getText(), 'DSC-V1');
$entry = $ifd0->getEntry(274);
// Orientation
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 6);
$this->assertEqual($entry->getText(), 'right - top');
$entry = $ifd0->getEntry(282);
// XResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 72, 1 => 1));
$this->assertEqual($entry->getText(), '72/1');
$entry = $ifd0->getEntry(283);
// YResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 72, 1 => 1));
$this->assertEqual($entry->getText(), '72/1');
$entry = $ifd0->getEntry(296);
// ResolutionUnit
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Inch');
$entry = $ifd0->getEntry(306);
// DateTime
$this->assertIsA($entry, 'PelEntryTime');
$this->assertEqual($entry->getValue(), 1089482993);
$this->assertEqual($entry->getText(), '2004:07:10 18:09:53');
$entry = $ifd0->getEntry(531);
// YCbCrPositioning
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'co-sited');
$entry = $ifd0->getEntry(50341);
// PrintIM
$this->assertIsA($entry, 'PelEntryUndefined');
$this->assertEqual($entry->getValue(), 'PrintIM' . "" . '0250' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '');
$this->assertEqual($entry->getText(), '(undefined)');
/* Sub IFDs of $ifd0. */
$this->assertEqual(count($ifd0->getSubIfds()), 1);
$ifd0_0 = $ifd0->getSubIfd(2);
// IFD Exif
$this->assertIsA($ifd0_0, 'PelIfd');
/* Start of IDF $ifd0_0. */
$this->assertEqual(count($ifd0_0->getEntries()), 26);
$entry = $ifd0_0->getEntry(33434);
// ExposureTime
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 10, 1 => 600));
$this->assertEqual($entry->getText(), '1/60 sec.');
$entry = $ifd0_0->getEntry(33437);
// FNumber
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 32, 1 => 10));
$this->assertEqual($entry->getText(), 'f/3.2');
$entry = $ifd0_0->getEntry(34850);
// ExposureProgram
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Normal program');
$entry = $ifd0_0->getEntry(34855);
// ISOSpeedRatings
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 100);
$this->assertEqual($entry->getText(), '100');
$entry = $ifd0_0->getEntry(36864);
// ExifVersion
$this->assertIsA($entry, 'PelEntryVersion');
$this->assertEqual($entry->getValue(), 2.2);
$this->assertEqual($entry->getText(), 'Exif Version 2.2');
$entry = $ifd0_0->getEntry(36867);
// DateTimeOriginal
$this->assertIsA($entry, 'PelEntryTime');
$this->assertEqual($entry->getValue(), 1089482993);
//.........这里部分代码省略.........
示例12: testRead
function testRead()
{
Pel::clearExceptions();
Pel::setStrictParsing(false);
$jpeg = new PelJpeg(dirname(__FILE__) . '/olympus-c5050z.jpg');
$exif = $jpeg->getExif();
$this->assertIsA($exif, 'PelExif');
$tiff = $exif->getTiff();
$this->assertIsA($tiff, 'PelTiff');
/* The first IFD. */
$ifd0 = $tiff->getIfd();
$this->assertIsA($ifd0, 'PelIfd');
/* Start of IDF $ifd0. */
$this->assertEqual(count($ifd0->getEntries()), 11);
$entry = $ifd0->getEntry(270);
// ImageDescription
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'OLYMPUS DIGITAL CAMERA ');
$this->assertEqual($entry->getText(), 'OLYMPUS DIGITAL CAMERA ');
$entry = $ifd0->getEntry(271);
// Make
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'OLYMPUS OPTICAL CO.,LTD');
$this->assertEqual($entry->getText(), 'OLYMPUS OPTICAL CO.,LTD');
$entry = $ifd0->getEntry(272);
// Model
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'C5050Z');
$this->assertEqual($entry->getText(), 'C5050Z');
$entry = $ifd0->getEntry(274);
// Orientation
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 1);
$this->assertEqual($entry->getText(), 'top - left');
$entry = $ifd0->getEntry(282);
// XResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 72, 1 => 1));
$this->assertEqual($entry->getText(), '72/1');
$entry = $ifd0->getEntry(283);
// YResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 72, 1 => 1));
$this->assertEqual($entry->getText(), '72/1');
$entry = $ifd0->getEntry(296);
// ResolutionUnit
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Inch');
$entry = $ifd0->getEntry(305);
// Software
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'v558-83');
$this->assertEqual($entry->getText(), 'v558-83');
$entry = $ifd0->getEntry(306);
// DateTime
$this->assertIsA($entry, 'PelEntryTime');
$this->assertEqual($entry->getValue(), false);
$this->assertEqual($entry->getText(), '0000:00:00 00:00:00');
$entry = $ifd0->getEntry(531);
// YCbCrPositioning
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'co-sited');
$entry = $ifd0->getEntry(50341);
// PrintIM
$this->assertIsA($entry, 'PelEntryUndefined');
$this->assertEqual($entry->getValue(), 'PrintIM' . "" . '0250' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . 'ˆ' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . ' ' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '
' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . 'Ð' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '
' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . 'è' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . 'ÿ' . "" . '' . "" . '' . "" . 'ƒ' . "" . '' . "" . '' . "" . 'ƒ' . "" . '' . "" . '' . "" . '€' . "" . '' . "" . '' . "" . 'ƒ' . "" . '' . "" . '' . "" . 'ƒ' . "" . '' . "" . '' . "" . '€€€' . "" . '€' . "" . '' . "" . '' . "" . ' ' . "" . '' . "" . '\'' . "" . '' . "" . '' . "" . '' . "" . '\'' . "" . '' . "" . '—' . "" . '' . "" . '\'' . "" . '' . "" . '°' . "" . '' . "" . '\'' . "" . '' . "" . '' . "" . '' . "" . '\'' . "" . '' . "" . '^' . "" . '' . "" . '\'' . "" . '' . "" . '‹' . "" . '' . "" . '' . "" . '\'' . "" . '' . "" . 'Ë' . "" . '' . "" . '\'' . "" . '' . "" . 'å' . "" . '' . "" . '\'' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '' . "" . '');
$this->assertEqual($entry->getText(), '(undefined)');
/* Sub IFDs of $ifd0. */
$this->assertEqual(count($ifd0->getSubIfds()), 1);
$ifd0_0 = $ifd0->getSubIfd(2);
// IFD Exif
$this->assertIsA($ifd0_0, 'PelIfd');
/* Start of IDF $ifd0_0. */
$this->assertEqual(count($ifd0_0->getEntries()), 32);
$entry = $ifd0_0->getEntry(33434);
// ExposureTime
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 10, 1 => 40));
$this->assertEqual($entry->getText(), '1/4 sec.');
$entry = $ifd0_0->getEntry(33437);
// FNumber
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 26, 1 => 10));
$this->assertEqual($entry->getText(), 'f/2.6');
$entry = $ifd0_0->getEntry(34850);
// ExposureProgram
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Normal program');
$entry = $ifd0_0->getEntry(34855);
// ISOSpeedRatings
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 64);
$this->assertEqual($entry->getText(), '64');
$entry = $ifd0_0->getEntry(36864);
// ExifVersion
//.........这里部分代码省略.........
示例13: testRead
function testRead()
{
Pel::clearExceptions();
Pel::setStrictParsing(false);
$jpeg = new PelJpeg(dirname(__FILE__) . '/sony-dsc-v1.jpg');
$exif = $jpeg->getExif();
$this->assertIsA($exif, 'PelExif');
$tiff = $exif->getTiff();
$this->assertIsA($tiff, 'PelTiff');
/* The first IFD. */
$ifd0 = $tiff->getIfd();
$this->assertIsA($ifd0, 'PelIfd');
/* Start of IDF $ifd0. */
$this->assertEqual(count($ifd0->getEntries()), 10);
$entry = $ifd0->getEntry(270);
// ImageDescription
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), ' ');
$this->assertEqual($entry->getText(), ' ');
$entry = $ifd0->getEntry(271);
// Make
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'SONY');
$this->assertEqual($entry->getText(), 'SONY');
$entry = $ifd0->getEntry(272);
// Model
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'DSC-V1');
$this->assertEqual($entry->getText(), 'DSC-V1');
$entry = $ifd0->getEntry(274);
// Orientation
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 6);
$this->assertEqual($entry->getText(), 'right - top');
$entry = $ifd0->getEntry(282);
// XResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 72, 1 => 1));
$this->assertEqual($entry->getText(), '72/1');
$entry = $ifd0->getEntry(283);
// YResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 72, 1 => 1));
$this->assertEqual($entry->getText(), '72/1');
$entry = $ifd0->getEntry(296);
// ResolutionUnit
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Inch');
$entry = $ifd0->getEntry(306);
// DateTime
$this->assertIsA($entry, 'PelEntryTime');
$this->assertEqual($entry->getValue(), 1089482993);
$this->assertEqual($entry->getText(), '2004:07:10 18:09:53');
$entry = $ifd0->getEntry(531);
// YCbCrPositioning
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'co-sited');
$entry = $ifd0->getEntry(50341);
// PrintIM
$this->assertIsA($entry, 'PelEntryUndefined');
$this->assertEqual($entry->getValue(), 'PrintIM0250');
$this->assertEqual($entry->getText(), '(undefined)');
/* Sub IFDs of $ifd0. */
$this->assertEqual(count($ifd0->getSubIfds()), 1);
$ifd0_0 = $ifd0->getSubIfd(2);
// IFD Exif
$this->assertIsA($ifd0_0, 'PelIfd');
/* Start of IDF $ifd0_0. */
$this->assertEqual(count($ifd0_0->getEntries()), 26);
$entry = $ifd0_0->getEntry(33434);
// ExposureTime
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 10, 1 => 600));
$this->assertEqual($entry->getText(), '1/60 sec.');
$entry = $ifd0_0->getEntry(33437);
// FNumber
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 32, 1 => 10));
$this->assertEqual($entry->getText(), 'f/3.2');
$entry = $ifd0_0->getEntry(34850);
// ExposureProgram
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Normal program');
$entry = $ifd0_0->getEntry(34855);
// ISOSpeedRatings
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 100);
$this->assertEqual($entry->getText(), '100');
$entry = $ifd0_0->getEntry(36864);
// ExifVersion
$this->assertIsA($entry, 'PelEntryVersion');
$this->assertEqual($entry->getValue(), 2.2);
$this->assertEqual($entry->getText(), 'Exif Version 2.2');
$entry = $ifd0_0->getEntry(36867);
// DateTimeOriginal
$this->assertIsA($entry, 'PelEntryTime');
$this->assertEqual($entry->getValue(), 1089482993);
//.........这里部分代码省略.........
示例14: testRead
function testRead()
{
Pel::clearExceptions();
Pel::setStrictParsing(false);
$jpeg = new PelJpeg(dirname(__FILE__) . '/nikon-e5000.jpg');
$exif = $jpeg->getExif();
$this->assertIsA($exif, 'PelExif');
$tiff = $exif->getTiff();
$this->assertIsA($tiff, 'PelTiff');
/* The first IFD. */
$ifd0 = $tiff->getIfd();
$this->assertIsA($ifd0, 'PelIfd');
/* Start of IDF $ifd0. */
$this->assertEqual(count($ifd0->getEntries()), 9);
$entry = $ifd0->getEntry(270);
// ImageDescription
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), ' ');
$this->assertEqual($entry->getText(), ' ');
$entry = $ifd0->getEntry(271);
// Make
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'NIKON');
$this->assertEqual($entry->getText(), 'NIKON');
$entry = $ifd0->getEntry(272);
// Model
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'E5000');
$this->assertEqual($entry->getText(), 'E5000');
$entry = $ifd0->getEntry(282);
// XResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 300, 1 => 1));
$this->assertEqual($entry->getText(), '300/1');
$entry = $ifd0->getEntry(283);
// YResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 300, 1 => 1));
$this->assertEqual($entry->getText(), '300/1');
$entry = $ifd0->getEntry(296);
// ResolutionUnit
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Inch');
$entry = $ifd0->getEntry(305);
// Software
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'E5000v1.6');
$this->assertEqual($entry->getText(), 'E5000v1.6');
$entry = $ifd0->getEntry(306);
// DateTime
$this->assertIsA($entry, 'PelEntryTime');
$this->assertEqual($entry->getValue(), 1021992832);
$this->assertEqual($entry->getText(), '2002:05:21 14:53:52');
$entry = $ifd0->getEntry(531);
// YCbCrPositioning
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 1);
$this->assertEqual($entry->getText(), 'centered');
/* Sub IFDs of $ifd0. */
$this->assertEqual(count($ifd0->getSubIfds()), 2);
$ifd0_0 = $ifd0->getSubIfd(2);
// IFD Exif
$this->assertIsA($ifd0_0, 'PelIfd');
/* Start of IDF $ifd0_0. */
$this->assertEqual(count($ifd0_0->getEntries()), 22);
$entry = $ifd0_0->getEntry(33434);
// ExposureTime
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 1642036, 1 => 100000000));
$this->assertEqual($entry->getText(), '1/60 sec.');
$entry = $ifd0_0->getEntry(33437);
// FNumber
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 28, 1 => 10));
$this->assertEqual($entry->getText(), 'f/2.8');
$entry = $ifd0_0->getEntry(34850);
// ExposureProgram
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Normal program');
$entry = $ifd0_0->getEntry(34855);
// ISOSpeedRatings
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 100);
$this->assertEqual($entry->getText(), '100');
$entry = $ifd0_0->getEntry(36864);
// ExifVersion
$this->assertIsA($entry, 'PelEntryVersion');
$this->assertEqual($entry->getValue(), 2.1);
$this->assertEqual($entry->getText(), 'Exif Version 2.1');
$entry = $ifd0_0->getEntry(36867);
// DateTimeOriginal
$this->assertIsA($entry, 'PelEntryTime');
$this->assertEqual($entry->getValue(), 1021992832);
$this->assertEqual($entry->getText(), '2002:05:21 14:53:52');
$entry = $ifd0_0->getEntry(36868);
// DateTimeDigitized
$this->assertIsA($entry, 'PelEntryTime');
$this->assertEqual($entry->getValue(), 1021992832);
//.........这里部分代码省略.........
示例15: testRead
function testRead()
{
Pel::clearExceptions();
Pel::setStrictParsing(false);
$jpeg = new PelJpeg(dirname(__FILE__) . '/pentax-istDS.jpg');
$exif = $jpeg->getExif();
$this->assertIsA($exif, 'PelExif');
$tiff = $exif->getTiff();
$this->assertIsA($tiff, 'PelTiff');
/* The first IFD. */
$ifd0 = $tiff->getIfd();
$this->assertIsA($ifd0, 'PelIfd');
/* Start of IDF $ifd0. */
$this->assertEqual(count($ifd0->getEntries()), 13);
$entry = $ifd0->getEntry(271);
// Make
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'PENTAX Corporation ');
$this->assertEqual($entry->getText(), 'PENTAX Corporation ');
$entry = $ifd0->getEntry(272);
// Model
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), 'PENTAX *ist DS ');
$this->assertEqual($entry->getText(), 'PENTAX *ist DS ');
$entry = $ifd0->getEntry(274);
// Orientation
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 1);
$this->assertEqual($entry->getText(), 'top - left');
$entry = $ifd0->getEntry(282);
// XResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 72, 1 => 1));
$this->assertEqual($entry->getText(), '72/1');
$entry = $ifd0->getEntry(283);
// YResolution
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 72, 1 => 1));
$this->assertEqual($entry->getText(), '72/1');
$entry = $ifd0->getEntry(296);
// ResolutionUnit
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'Inch');
$entry = $ifd0->getEntry(305);
// Software
$this->assertIsA($entry, 'PelEntryAscii');
$this->assertEqual($entry->getValue(), '*ist DS Ver 1.00 ');
$this->assertEqual($entry->getText(), '*ist DS Ver 1.00 ');
$entry = $ifd0->getEntry(306);
// DateTime
$this->assertIsA($entry, 'PelEntryTime');
$this->assertEqual($entry->getValue(), 1106749970);
$this->assertEqual($entry->getText(), '2005:01:26 14:32:50');
$entry = $ifd0->getEntry(318);
// WhitePoint
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => array(0 => 313, 1 => 1000), 1 => array(0 => 329, 1 => 1000)));
$this->assertEqual($entry->getText(), '313/1000, 329/1000');
$entry = $ifd0->getEntry(319);
// PrimaryChromaticities
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => array(0 => 64, 1 => 100), 1 => array(0 => 33, 1 => 100), 2 => array(0 => 21, 1 => 100), 3 => array(0 => 71, 1 => 100), 4 => array(0 => 15, 1 => 100), 5 => array(0 => 6, 1 => 100)));
$this->assertEqual($entry->getText(), '64/100, 33/100, 21/100, 71/100, 15/100, 6/100');
$entry = $ifd0->getEntry(529);
// YCbCrCoefficients
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => array(0 => 299, 1 => 1000), 1 => array(0 => 587, 1 => 1000), 2 => array(0 => 114, 1 => 1000)));
$this->assertEqual($entry->getText(), '299/1000, 587/1000, 114/1000');
$entry = $ifd0->getEntry(531);
// YCbCrPositioning
$this->assertIsA($entry, 'PelEntryShort');
$this->assertEqual($entry->getValue(), 2);
$this->assertEqual($entry->getText(), 'co-sited');
$entry = $ifd0->getEntry(50341);
// PrintIM
$this->assertIsA($entry, 'PelEntryUndefined');
$this->assertEqual($entry->getValue(), 'PrintIM0300!�
4����������
D
������\'\'�\'\'\'q\'x\'�\'a\'\'');
$this->assertEqual($entry->getText(), '(undefined)');
/* Sub IFDs of $ifd0. */
$this->assertEqual(count($ifd0->getSubIfds()), 1);
$ifd0_0 = $ifd0->getSubIfd(2);
// IFD Exif
$this->assertIsA($ifd0_0, 'PelIfd');
/* Start of IDF $ifd0_0. */
$this->assertEqual(count($ifd0_0->getEntries()), 30);
$entry = $ifd0_0->getEntry(33434);
// ExposureTime
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 1, 1 => 4));
$this->assertEqual($entry->getText(), '1/4 sec.');
$entry = $ifd0_0->getEntry(33437);
// FNumber
$this->assertIsA($entry, 'PelEntryRational');
$this->assertEqual($entry->getValue(), array(0 => 45, 1 => 10));
$this->assertEqual($entry->getText(), 'f/4.5');
//.........这里部分代码省略.........