Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / lsolesen / pel / test / image-tests / CanonPowershotS60Test.php
diff --git a/vendor/lsolesen/pel/test/image-tests/CanonPowershotS60Test.php b/vendor/lsolesen/pel/test/image-tests/CanonPowershotS60Test.php
new file mode 100644 (file)
index 0000000..0640dc4
--- /dev/null
@@ -0,0 +1,383 @@
+<?php
+
+/*
+ * PEL: PHP Exif Library. A library with support for reading and
+ * writing all Exif headers in JPEG and TIFF images using PHP.
+ *
+ * Copyright (C) 2005, 2006 Martin Geisler.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program in the file COPYING; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+use lsolesen\pel\Pel;
+use lsolesen\pel\PelJpeg;
+
+class CanonPowershotS60Test extends \PHPUnit_Framework_TestCase
+{
+    public function testRead()
+    {
+        Pel::clearExceptions();
+        Pel::setStrictParsing(false);
+        $jpeg = new PelJpeg(dirname(__FILE__) . '/canon-powershot-s60.jpg');
+
+        $exif = $jpeg->getExif();
+        $this->assertInstanceOf('lsolesen\pel\PelExif', $exif);
+
+        $tiff = $exif->getTiff();
+        $this->assertInstanceOf('lsolesen\pel\PelTiff', $tiff);
+
+        /* The first IFD. */
+        $ifd0 = $tiff->getIfd();
+        $this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0);
+
+        /* Start of IDF $ifd0. */
+        $this->assertEquals(count($ifd0->getEntries()), 8);
+
+        $entry = $ifd0->getEntry(271); // Make
+        $this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
+        $this->assertEquals($entry->getValue(), 'Canon');
+        $this->assertEquals($entry->getText(), 'Canon');
+
+        $entry = $ifd0->getEntry(272); // Model
+        $this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
+        $this->assertEquals($entry->getValue(), 'Canon PowerShot S60');
+        $this->assertEquals($entry->getText(), 'Canon PowerShot S60');
+
+        $entry = $ifd0->getEntry(274); // Orientation
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 1);
+        $this->assertEquals($entry->getText(), 'top - left');
+
+        $entry = $ifd0->getEntry(282); // XResolution
+        $this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
+        $this->assertEquals($entry->getValue(), array(
+            0 => 180,
+            1 => 1
+        ));
+        $this->assertEquals($entry->getText(), '180/1');
+
+        $entry = $ifd0->getEntry(283); // YResolution
+        $this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
+        $this->assertEquals($entry->getValue(), array(
+            0 => 180,
+            1 => 1
+        ));
+        $this->assertEquals($entry->getText(), '180/1');
+
+        $entry = $ifd0->getEntry(296); // ResolutionUnit
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 2);
+        $this->assertEquals($entry->getText(), 'Inch');
+
+        $entry = $ifd0->getEntry(306); // DateTime
+        $this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
+        $this->assertEquals($entry->getValue(), 1097316018);
+        $this->assertEquals($entry->getText(), '2004:10:09 10:00:18');
+
+        $entry = $ifd0->getEntry(531); // YCbCrPositioning
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 1);
+        $this->assertEquals($entry->getText(), 'centered');
+
+        /* Sub IFDs of $ifd0. */
+        $this->assertEquals(count($ifd0->getSubIfds()), 1);
+        $ifd0_0 = $ifd0->getSubIfd(2); // IFD Exif
+        $this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0);
+
+        /* Start of IDF $ifd0_0. */
+        $this->assertEquals(count($ifd0_0->getEntries()), 30);
+
+        $entry = $ifd0_0->getEntry(33434); // ExposureTime
+        $this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
+        $this->assertEquals($entry->getValue(), array(
+            0 => 1,
+            1 => 8
+        ));
+        $this->assertEquals($entry->getText(), '1/8 sec.');
+
+        $entry = $ifd0_0->getEntry(33437); // FNumber
+        $this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
+        $this->assertEquals($entry->getValue(), array(
+            0 => 53,
+            1 => 10
+        ));
+        $this->assertEquals($entry->getText(), 'f/5.3');
+
+        $entry = $ifd0_0->getEntry(36864); // ExifVersion
+        $this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
+        $this->assertEquals($entry->getValue(), 2.2);
+        $this->assertEquals($entry->getText(), 'Exif Version 2.2');
+
+        $entry = $ifd0_0->getEntry(36867); // DateTimeOriginal
+        $this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
+        $this->assertEquals($entry->getValue(), 1097316018);
+        $this->assertEquals($entry->getText(), '2004:10:09 10:00:18');
+
+        $entry = $ifd0_0->getEntry(36868); // DateTimeDigitized
+        $this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
+        $this->assertEquals($entry->getValue(), 1097316018);
+        $this->assertEquals($entry->getText(), '2004:10:09 10:00:18');
+
+        $entry = $ifd0_0->getEntry(37121); // ComponentsConfiguration
+        $this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
+        $this->assertEquals($entry->getValue(), "\x01\x02\x03\0");
+        $this->assertEquals($entry->getText(), 'Y Cb Cr -');
+
+        $entry = $ifd0_0->getEntry(37122); // CompressedBitsPerPixel
+        $this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
+        $this->assertEquals($entry->getValue(), array(
+            0 => 2,
+            1 => 1
+        ));
+        $this->assertEquals($entry->getText(), '2/1');
+
+        $entry = $ifd0_0->getEntry(37377); // ShutterSpeedValue
+        $this->assertInstanceOf('lsolesen\pel\PelEntrySRational', $entry);
+        $this->assertEquals($entry->getValue(), array(
+            0 => 96,
+            1 => 32
+        ));
+        $this->assertEquals($entry->getText(), '96/32 sec. (APEX: 2)');
+
+        $entry = $ifd0_0->getEntry(37378); // ApertureValue
+        $this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
+        $this->assertEquals($entry->getValue(), array(
+            0 => 154,
+            1 => 32
+        ));
+        $this->assertEquals($entry->getText(), 'f/5.3');
+
+        $entry = $ifd0_0->getEntry(37380); // ExposureBiasValue
+        $this->assertInstanceOf('lsolesen\pel\PelEntrySRational', $entry);
+        $this->assertEquals($entry->getValue(), array(
+            0 => 0,
+            1 => 3
+        ));
+        $this->assertEquals($entry->getText(), '0.0');
+
+        $entry = $ifd0_0->getEntry(37381); // MaxApertureValue
+        $this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
+        $this->assertEquals($entry->getValue(), array(
+            0 => 154,
+            1 => 32
+        ));
+        $this->assertEquals($entry->getText(), '154/32');
+
+        $entry = $ifd0_0->getEntry(37383); // MeteringMode
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 5);
+        $this->assertEquals($entry->getText(), 'Pattern');
+
+        $entry = $ifd0_0->getEntry(37385); // Flash
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 16);
+        $this->assertEquals($entry->getText(), 'Flash did not fire, compulsory flash mode.');
+
+        $entry = $ifd0_0->getEntry(37386); // FocalLength
+        $this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
+        $this->assertEquals($entry->getValue(), array(
+            0 => 662,
+            1 => 32
+        ));
+        $this->assertEquals($entry->getText(), '20.7 mm');
+
+        $entry = $ifd0_0->getEntry(37500); // MakerNote
+        $this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
+        $expected = "\x11\0\x01\0\x03\0\x2e\0\0\0\x80\x04\0\0\x02\0\x03\0\x04\0\0\0\xdc\x04\0\0\x03\0\x03\0\x04\0\0\0\xe4\x04\0\0\x04\0\x03\0\x22\0\0\0\xec\x04\0\0\0\0\x03\0\x06\0\0\0\x30\x05\0\0\0\0\x03\0\x04\0\0\0\x3c\x05\0\0\x12\0\x03\0\x1c\0\0\0\x44\x05\0\0\x13\0\x03\0\x04\0\0\0\x7c\x05\0\0\x06\0\x02\0\x20\0\0\0\x84\x05\0\0\x07\0\x02\0\x18\0\0\0\xa4\x05\0\0\x08\0\x04\0\x01\0\0\0\x69\x42\x0f\0\x09\0\x02\0\x20\0\0\0\xbc\x05\0\0\x10\0\x04\0\x01\0\0\0\0\0\x39\x01\0\0\x03\0\x05\0\0\0\xdc\x05\0\0\x18\0\x01\0\0\x01\0\0\xe6\x05\0\0\x19\0\x03\0\x01\0\0\0\x01\0\0\0\x0d\0\x03\0\x24\0\0\0\xe6\x06\0\0\0\0\0\0\x5c\0\x02\0\0\0\x02\0\0\0\0\0\0\0\x04\0\0\0\x01\0\x02\0\0\0\0\0\0\0\0\0\0\0\x0f\0\x03\0\x01\0\x01\x40\0\0\xff\x7f\xff\xff\x96\x02\xba\0\x20\0\x9d\0\xc0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\xff\xff\x35\0\x20\x0a\x20\x0a\0\0\0\0\0\0\0\0\xff\x7f\xff\x7f\0\0\0\0\x02\0\x96\x02\x22\x01\xd9\0\0\0\0\0\0\0\0\0\x44\0\x20\0\x80\0\x36\0\x9a\0\x60\0\0\0\0\0\0\0\0\0\x08\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\0\x6a\0\0\0\x9d\0\x60\0\0\0\0\0\x01\0\xfa\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x09\0\x09\0\x80\x02\xe0\x01\x20\x0a\xd8\0\xd3\x01\x27\0\x2c\xfe\0\0\xd4\x01\x2c\xfe\0\0\xd4\x01\x2c\xfe\0\0\xd4\x01\xd6\xff\xd6\xff\xd6\xff\0\0\0\0\0\0\x2a\0\x2a\0\x2a\0\x20\0\x05\0\0\0\0\0\0\0\0\0\x49\x4d\x47\x3a\x50\x6f\x77\x65\x72\x53\x68\x6f\x74\x20\x53\x36\x30\x20\x4a\x50\x45\x47\0\0\0\0\0\0\0\0\0\0\x46\x69\x72\x6d\x77\x61\x72\x65\x20\x56\x65\x72\x73\x69\x6f\x6e\x20\x31\x2e\x30\x30\0\0\0\0\x51\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x0a\0\x02\0\x02\0\x80\x02\xe0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x48\0\x09\0\x7f\x02\x7c\x02\x7c\x02\x7d\x02\x7a\x02\x80\x02\x7c\x02\x81\x02\x7a\x02\x44\0\0\0\0\0\x58\xff\x02\0\0\0\x0a\0\xfe\xff\0\0\x0a\0\x74\0\xc7\0\x25\0\x01\0\xdc\x03\0\0\0\0\0\0\0\0\0\0\x2a\0\0\0\0\0\x80\0\xe0\0\x49\x49\x2a\0\xae\x03\0\0";
+        $this->assertEquals($entry->getValue(), $expected);
+        $this->assertEquals($entry->getText(), '904 bytes unknown MakerNote data');
+
+        $entry = $ifd0_0->getEntry(37510); // UserComment
+        $this->assertInstanceOf('lsolesen\pel\PelEntryUserComment', $entry);
+        $expected = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
+        $this->assertEquals($entry->getValue(), $expected);
+        $expected = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
+        $this->assertEquals($entry->getText(), $expected);
+
+        $entry = $ifd0_0->getEntry(40960); // FlashPixVersion
+        $this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
+        $this->assertEquals($entry->getValue(), 1);
+        $this->assertEquals($entry->getText(), 'FlashPix Version 1.0');
+
+        $entry = $ifd0_0->getEntry(40961); // ColorSpace
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 1);
+        $this->assertEquals($entry->getText(), 'sRGB');
+
+        $entry = $ifd0_0->getEntry(40962); // PixelXDimension
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 640);
+        $this->assertEquals($entry->getText(), '640');
+
+        $entry = $ifd0_0->getEntry(40963); // PixelYDimension
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 480);
+        $this->assertEquals($entry->getText(), '480');
+
+        $entry = $ifd0_0->getEntry(41486); // FocalPlaneXResolution
+        $this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
+        $this->assertEquals($entry->getValue(), array(
+            0 => 640000,
+            1 => 283
+        ));
+        $this->assertEquals($entry->getText(), '640000/283');
+
+        $entry = $ifd0_0->getEntry(41487); // FocalPlaneYResolution
+        $this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
+        $this->assertEquals($entry->getValue(), array(
+            0 => 480000,
+            1 => 212
+        ));
+        $this->assertEquals($entry->getText(), '480000/212');
+
+        $entry = $ifd0_0->getEntry(41488); // FocalPlaneResolutionUnit
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 2);
+        $this->assertEquals($entry->getText(), 'Inch');
+
+        $entry = $ifd0_0->getEntry(41495); // SensingMethod
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 2);
+        $this->assertEquals($entry->getText(), 'One-chip color area sensor');
+
+        $entry = $ifd0_0->getEntry(41728); // FileSource
+        $this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
+        $this->assertEquals($entry->getValue(), "\x03");
+        $this->assertEquals($entry->getText(), 'DSC');
+
+        $entry = $ifd0_0->getEntry(41985); // CustomRendered
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 0);
+        $this->assertEquals($entry->getText(), 'Normal process');
+
+        $entry = $ifd0_0->getEntry(41986); // ExposureMode
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 0);
+        $this->assertEquals($entry->getText(), 'Auto exposure');
+
+        $entry = $ifd0_0->getEntry(41987); // WhiteBalance
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 0);
+        $this->assertEquals($entry->getText(), 'Auto white balance');
+
+        $entry = $ifd0_0->getEntry(41988); // DigitalZoomRatio
+        $this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
+        $this->assertEquals($entry->getValue(), array(
+            0 => 2592,
+            1 => 2592
+        ));
+        $this->assertEquals($entry->getText(), '2592/2592');
+
+        $entry = $ifd0_0->getEntry(41990); // SceneCaptureType
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 0);
+        $this->assertEquals($entry->getText(), 'Standard');
+
+        /* Sub IFDs of $ifd0_0. */
+        $this->assertEquals(count($ifd0_0->getSubIfds()), 1);
+        $ifd0_0_0 = $ifd0_0->getSubIfd(4); // IFD Interoperability
+        $this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0_0);
+
+        /* Start of IDF $ifd0_0_0. */
+        $this->assertEquals(count($ifd0_0_0->getEntries()), 4);
+
+        $entry = $ifd0_0_0->getEntry(1); // InteroperabilityIndex
+        $this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
+        $this->assertEquals($entry->getValue(), 'R98');
+        $this->assertEquals($entry->getText(), 'R98');
+
+        $entry = $ifd0_0_0->getEntry(2); // InteroperabilityVersion
+        $this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
+        $this->assertEquals($entry->getValue(), 1);
+        $this->assertEquals($entry->getText(), 'Interoperability Version 1.0');
+
+        $entry = $ifd0_0_0->getEntry(4097); // RelatedImageWidth
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 640);
+        $this->assertEquals($entry->getText(), '640');
+
+        $entry = $ifd0_0_0->getEntry(4098); // RelatedImageLength
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 480);
+        $this->assertEquals($entry->getText(), '480');
+
+        /* Sub IFDs of $ifd0_0_0. */
+        $this->assertEquals(count($ifd0_0_0->getSubIfds()), 0);
+
+        $this->assertEquals($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->assertEquals($ifd0_0->getThumbnailData(), '');
+
+        /* Next IFD. */
+        $ifd0_1 = $ifd0_0->getNextIfd();
+        $this->assertNull($ifd0_1);
+        /* End of IFD $ifd0_0. */
+
+        $this->assertEquals($ifd0->getThumbnailData(), '');
+
+        /* Next IFD. */
+        $ifd1 = $ifd0->getNextIfd();
+        $this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd1);
+        /* End of IFD $ifd0. */
+
+        /* Start of IDF $ifd1. */
+        $this->assertEquals(count($ifd1->getEntries()), 4);
+
+        $entry = $ifd1->getEntry(259); // Compression
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 6);
+        $this->assertEquals($entry->getText(), 'JPEG compression');
+
+        $entry = $ifd1->getEntry(282); // XResolution
+        $this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
+        $this->assertEquals($entry->getValue(), array(
+            0 => 180,
+            1 => 1
+        ));
+        $this->assertEquals($entry->getText(), '180/1');
+
+        $entry = $ifd1->getEntry(283); // YResolution
+        $this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
+        $this->assertEquals($entry->getValue(), array(
+            0 => 180,
+            1 => 1
+        ));
+        $this->assertEquals($entry->getText(), '180/1');
+
+        $entry = $ifd1->getEntry(296); // ResolutionUnit
+        $this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
+        $this->assertEquals($entry->getValue(), 2);
+        $this->assertEquals($entry->getText(), 'Inch');
+
+        /* Sub IFDs of $ifd1. */
+        $this->assertEquals(count($ifd1->getSubIfds()), 0);
+
+        $thumb_data = file_get_contents(dirname(__FILE__) . '/canon-powershot-s60-thumb.jpg');
+        $this->assertEquals($ifd1->getThumbnailData(), $thumb_data);
+
+        /* Next IFD. */
+        $ifd2 = $ifd1->getNextIfd();
+        $this->assertNull($ifd2);
+        /* End of IFD $ifd1. */
+
+        $this->assertTrue(count(Pel::getExceptions()) == 0);
+    }
+}