当前位置: 首页>>代码示例>>PHP>>正文


PHP Pel类代码示例

本文整理汇总了PHP中Pel的典型用法代码示例。如果您正苦于以下问题:PHP Pel类的具体用法?PHP Pel怎么用?PHP Pel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Pel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct($min, $max)
 {
     Pel::setStrictParsing(true);
     $this->min = $min;
     $this->max = $max;
     parent::__construct('PEL Exif Number Tests');
 }
开发者ID:kbrack1,项目名称:UptoBox,代码行数:7,代码来源:number.php

示例2: 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);
 }
开发者ID:kbrack1,项目名称:UptoBox,代码行数:9,代码来源:no-exif.php

示例3: testWriteRead

 function testWriteRead()
 {
     Pel::setStrictParsing(true);
     $ifd = new PelIfd(PelIfd::IFD0);
     $this->assertTrue($ifd->isLastIfd());
     foreach ($this->entries as $entry) {
         $ifd->addEntry($entry);
     }
     $tiff = new PelTiff();
     $this->assertNull($tiff->getIfd());
     $tiff->setIfd($ifd);
     $this->assertNotNull($tiff->getIfd());
     $exif = new PelExif();
     $this->assertNull($exif->getTiff());
     $exif->setTiff($tiff);
     $this->assertNotNull($exif->getTiff());
     $jpeg = new PelJpeg(dirname(__FILE__) . '/no-exif.jpg');
     $this->assertNull($jpeg->getExif());
     $jpeg->setExif($exif);
     $this->assertNotNull($jpeg->getExif());
     $jpeg->saveFile('test-output.jpg');
     $this->assertTrue(file_exists('test-output.jpg'));
     $this->assertTrue(filesize('test-output.jpg') > 0);
     /* Now read the file and see if the entries are still there. */
     $jpeg = new PelJpeg('test-output.jpg');
     $exif = $jpeg->getExif();
     $this->assertIsA($exif, 'PelExif');
     $tiff = $exif->getTiff();
     $this->assertIsA($tiff, 'PelTiff');
     $ifd = $tiff->getIfd();
     $this->assertIsA($ifd, 'PelIfd');
     $this->assertEqual($ifd->getType(), PelIfd::IFD0);
     $this->assertTrue($ifd->isLastIfd());
     foreach ($this->entries as $entry) {
         $this->assertEqual($ifd->getEntry($entry->getTag())->getValue(), $entry->getValue());
     }
     unlink('test-output.jpg');
 }
开发者ID:ni-c,项目名称:pel,代码行数:38,代码来源:read-write.php

示例4: getText

 /**
  * Get the value of an entry as text.
  *
  * The value will be returned in a format suitable for presentation,
  * e.g., rationals will be returned as 'x/y', ASCII strings will be
  * returned as themselves etc.
  *
  * @param boolean some values can be returned in a long or more
  * brief form, and this parameter controls that.
  *
  * @return string the value as text.
  */
 function getText($brief = false)
 {
     if (isset($this->value[0])) {
         $v = $this->value[0];
     }
     switch ($this->tag) {
         case PelTag::SHUTTER_SPEED_VALUE:
             //CC (e->components, 1, v);
             //if (!v_srat.denominator) return (NULL);
             return Pel::fmt('%.0f/%.0f sec. (APEX: %d)', $v[0], $v[1], pow(sqrt(2), $v[0] / $v[1]));
         case PelTag::BRIGHTNESS_VALUE:
             //CC (e->components, 1, v);
             //
             // TODO: figure out the APEX thing, or remove this so that it is
             // handled by the default clause at the bottom.
             return sprintf('%d/%d', $v[0], $v[1]);
             //FIXME: How do I calculate the APEX value?
         //FIXME: How do I calculate the APEX value?
         case PelTag::EXPOSURE_BIAS_VALUE:
             //CC (e->components, 1, v);
             //if (!v_srat.denominator) return (NULL);
             return sprintf('%s%.01f', $v[0] * $v[1] > 0 ? '+' : '', $v[0] / $v[1]);
         default:
             return parent::getText($brief);
     }
 }
开发者ID:mict404,项目名称:owaspctf,代码行数:38,代码来源:PelEntryRational.php

示例5: validateNumber

 /**
  * Validate a number.
  *
  * This method will check that the number given is within the range
  * given my {@link getMin()} and {@link getMax()}, inclusive.  If
  * not, then a {@link PelOverflowException} is thrown.
  *
  * @param int|array the number in question.
  *
  * @return void nothing, but will throw a {@link
  * PelOverflowException} if the number is found to be outside the
  * legal range and {@link Pel::$strict} is true.
  */
 function validateNumber($n)
 {
     if ($this->dimension == 1) {
         if ($n < $this->min || $n > $this->max) {
             Pel::maybeThrow(new PelOverflowException($n, $this->min, $this->max));
         }
     } else {
         for ($i = 0; $i < $this->dimension; $i++) {
             if ($n[$i] < $this->min || $n[$i] > $this->max) {
                 Pel::maybeThrow(new PelOverflowException($n[$i], $this->min, $this->max));
             }
         }
     }
 }
开发者ID:jdrzaic,项目名称:joomla-dummy,代码行数:27,代码来源:PelEntryNumber.php

示例6: __toString

 /**
  * Return a string representation of this object.
  *
  * @return string a string describing this object. This is mostly
  *         useful for debugging.
  */
 public function __toString()
 {
     return Pel::tra("Dumping Exif data...\n") . $this->tiff->__toString();
 }
开发者ID:jmstan,项目名称:craft-website,代码行数:10,代码来源:PelExif.php

示例7: __toString

 /**
  * Make a string representation of this JPEG object.
  *
  * This is mainly usefull for debugging.  It will show the structure
  * of the image, and its sections.
  *
  * @return string debugging information about this JPEG object.
  */
 function __toString()
 {
     $str = Pel::tra("Dumping JPEG data...\n");
     for ($i = 0; $i < count($this->sections); $i++) {
         $m = $this->sections[$i][0];
         $c = $this->sections[$i][1];
         $str .= Pel::fmt("Section %d (marker 0x%02X - %s):\n", $i, $m, PelJpegMarker::getName($m));
         $str .= Pel::fmt("  Description: %s\n", PelJpegMarker::getDescription($m));
         if ($m == PelJpegMarker::SOI || $m == PelJpegMarker::EOI) {
             continue;
         }
         if ($c instanceof PelExif) {
             $str .= Pel::tra("  Content    : Exif data\n");
             $str .= $c->__toString() . "\n";
         } elseif ($c instanceof PelJpegComment) {
             $str .= Pel::fmt("  Content    : %s\n", $c->getValue());
         } else {
             $str .= Pel::tra("  Content    : Unknown\n");
         }
     }
     return $str;
 }
开发者ID:sansandeep143,项目名称:av,代码行数:30,代码来源:PelJpeg.php

示例8: testRead

    function testRead()
    {
        Pel::clearExceptions();
        Pel::setStrictParsing(false);
        $jpeg = new PelJpeg(dirname(__FILE__) . '/canon-powershot-s60.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()), 8);
        $entry = $ifd0->getEntry(271);
        // Make
        $this->assertIsA($entry, 'PelEntryAscii');
        $this->assertEqual($entry->getValue(), 'Canon');
        $this->assertEqual($entry->getText(), 'Canon');
        $entry = $ifd0->getEntry(272);
        // Model
        $this->assertIsA($entry, 'PelEntryAscii');
        $this->assertEqual($entry->getValue(), 'Canon PowerShot S60');
        $this->assertEqual($entry->getText(), 'Canon PowerShot S60');
        $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 => 180, 1 => 1));
        $this->assertEqual($entry->getText(), '180/1');
        $entry = $ifd0->getEntry(283);
        // YResolution
        $this->assertIsA($entry, 'PelEntryRational');
        $this->assertEqual($entry->getValue(), array(0 => 180, 1 => 1));
        $this->assertEqual($entry->getText(), '180/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(), 1097316018);
        $this->assertEqual($entry->getText(), '2004:10:09 10:00:18');
        $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()), 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 => 8));
        $this->assertEqual($entry->getText(), '1/8 sec.');
        $entry = $ifd0_0->getEntry(33437);
        // FNumber
        $this->assertIsA($entry, 'PelEntryRational');
        $this->assertEqual($entry->getValue(), array(0 => 53, 1 => 10));
        $this->assertEqual($entry->getText(), 'f/5.3');
        $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(), 1097316018);
        $this->assertEqual($entry->getText(), '2004:10:09 10:00:18');
        $entry = $ifd0_0->getEntry(36868);
        // DateTimeDigitized
        $this->assertIsA($entry, 'PelEntryTime');
        $this->assertEqual($entry->getValue(), 1097316018);
        $this->assertEqual($entry->getText(), '2004:10:09 10:00:18');
        $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(37122);
        // CompressedBitsPerPixel
        $this->assertIsA($entry, 'PelEntryRational');
        $this->assertEqual($entry->getValue(), array(0 => 2, 1 => 1));
        $this->assertEqual($entry->getText(), '2/1');
        $entry = $ifd0_0->getEntry(37377);
        // ShutterSpeedValue
        $this->assertIsA($entry, 'PelEntrySRational');
        $this->assertEqual($entry->getValue(), array(0 => 96, 1 => 32));
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:pic2base-svn,代码行数:101,代码来源:canon-powershot-s60.php

示例9: __toString

 /**
  * Turn this entry into a string.
  *
  * @return string a string representation of this entry.  This is
  * mostly for debugging.
  */
 function __toString()
 {
     $str = Pel::fmt("  Tag: 0x%04X (%s)\n", $this->tag, PelTag::getName($this->ifd_type, $this->tag));
     $str .= Pel::fmt("    Format    : %d (%s)\n", $this->format, PelFormat::getName($this->format));
     $str .= Pel::fmt("    Components: %d\n", $this->components);
     if ($this->getTag() != PelTag::MAKER_NOTE && $this->getTag() != PelTag::PRINT_IM) {
         $str .= Pel::fmt("    Value     : %s\n", print_r($this->getValue(), true));
     }
     $str .= Pel::fmt("    Text      : %s\n", $this->getText());
     return $str;
 }
开发者ID:jdrzaic,项目名称:joomla-dummy,代码行数:17,代码来源:PelEntry.php

示例10: 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();
    }
}
开发者ID:Peter2121,项目名称:leonardoxc,代码行数:31,代码来源:dump-image.php

示例11: 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
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:pic2base-svn,代码行数:101,代码来源:olympus-c50z.php

示例12: __toString

 /**
  * Return a string representation of the data window.
  *
  * @return string a description of the window with information about
  *         the number of bytes accessible, the total number of bytes, and
  *         the window start and stop.
  */
 public function __toString()
 {
     return Pel::fmt('DataWindow: %d bytes in [%d, %d] of %d bytes', $this->size, $this->start, $this->start + $this->size, strlen($this->data));
 }
开发者ID:jmstan,项目名称:craft-website,代码行数:11,代码来源:PelDataWindow.php

示例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(), '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);
//.........这里部分代码省略.........
开发者ID:ni-c,项目名称:pel,代码行数:101,代码来源:sony-dsc-v1.php

示例14: setlocale

setlocale(LC_ALL, '');
/* Load the required PEL files for handling JPEG images. */
require_once '../autoload.php';
use lsolesen\pel\PelJpeg;
/*
 * Store the name of the script in $prog and remove this first part of
 * the command line.
 */
$prog = array_shift($argv);
$error = false;
/*
 * The next argument could be -d to signal debug mode where lots of
 * extra information is printed out when the image is parsed.
 */
if (isset($argv[0]) && $argv[0] == '-d') {
    Pel::setDebug(true);
    array_shift($argv);
}
/* The mandatory input filename. */
if (isset($argv[0])) {
    $input = array_shift($argv);
} else {
    $error = true;
}
/* The mandatory output filename. */
if (isset($argv[0])) {
    $output = array_shift($argv);
} else {
    $error = true;
}
/* The mandatory scale factor. */
开发者ID:lsolesen,项目名称:pel,代码行数:31,代码来源:resize.php

示例15: getTitle

 /**
  * Returns a title for an Exif tag.
  *
  * @param
  *            int the IFD type of the tag, one of {@link PelIfd::IFD0},
  *            {@link PelIfd::IFD1}, {@link PelIfd::EXIF}, {@link PelIfd::GPS},
  *            or {@link PelIfd::INTEROPERABILITY}.
  *
  * @param
  *            PelTag the tag.
  *
  * @return string the title of the tag, e.g., 'Image Width' for the
  *         {@link IMAGE_WIDTH} tag. If the tag isn't known, the string
  *         'Unknown Tag: 0xTT' will be returned where 'TT' is the
  *         hexadecimal representation of the tag.
  */
 public function getTitle($type, $tag)
 {
     switch ($type) {
         case PelIfd::IFD0:
         case PelIfd::IFD1:
         case PelIfd::EXIF:
         case PelIfd::INTEROPERABILITY:
             switch ($tag) {
                 case self::INTEROPERABILITY_INDEX:
                     return Pel::tra('Interoperability Index');
                 case self::INTEROPERABILITY_VERSION:
                     return Pel::tra('Interoperability Version');
                 case self::IMAGE_WIDTH:
                     return Pel::tra('Image Width');
                 case self::IMAGE_LENGTH:
                     return Pel::tra('Image Length');
                 case self::BITS_PER_SAMPLE:
                     return Pel::tra('Bits per Sample');
                 case self::COMPRESSION:
                     return Pel::tra('Compression');
                 case self::PHOTOMETRIC_INTERPRETATION:
                     return Pel::tra('Photometric Interpretation');
                 case self::FILL_ORDER:
                     return Pel::tra('Fill Order');
                 case self::DOCUMENT_NAME:
                     return Pel::tra('Document Name');
                 case self::IMAGE_DESCRIPTION:
                     return Pel::tra('Image Description');
                 case self::MAKE:
                     return Pel::tra('Manufacturer');
                 case self::MODEL:
                     return Pel::tra('Model');
                 case self::STRIP_OFFSETS:
                     return Pel::tra('Strip Offsets');
                 case self::ORIENTATION:
                     return Pel::tra('Orientation');
                 case self::SAMPLES_PER_PIXEL:
                     return Pel::tra('Samples per Pixel');
                 case self::ROWS_PER_STRIP:
                     return Pel::tra('Rows per Strip');
                 case self::STRIP_BYTE_COUNTS:
                     return Pel::tra('Strip Byte Count');
                 case self::X_RESOLUTION:
                     return Pel::tra('x-Resolution');
                 case self::Y_RESOLUTION:
                     return Pel::tra('y-Resolution');
                 case self::PLANAR_CONFIGURATION:
                     return Pel::tra('Planar Configuration');
                 case self::RESOLUTION_UNIT:
                     return Pel::tra('Resolution Unit');
                 case self::TRANSFER_FUNCTION:
                     return Pel::tra('Transfer Function');
                 case self::SOFTWARE:
                     return Pel::tra('Software');
                 case self::DATE_TIME:
                     return Pel::tra('Date and Time');
                 case self::ARTIST:
                     return Pel::tra('Artist');
                 case self::WHITE_POINT:
                     return Pel::tra('White Point');
                 case self::PRIMARY_CHROMATICITIES:
                     return Pel::tra('Primary Chromaticities');
                 case self::TRANSFER_RANGE:
                     return Pel::tra('Transfer Range');
                 case self::JPEG_PROC:
                     return Pel::tra('JPEG Process');
                 case self::JPEG_INTERCHANGE_FORMAT:
                     return Pel::tra('JPEG Interchange Format');
                 case self::JPEG_INTERCHANGE_FORMAT_LENGTH:
                     return Pel::tra('JPEG Interchange Format Length');
                 case self::YCBCR_COEFFICIENTS:
                     return Pel::tra('YCbCr Coefficients');
                 case self::YCBCR_SUB_SAMPLING:
                     return Pel::tra('YCbCr Sub-Sampling');
                 case self::YCBCR_POSITIONING:
                     return Pel::tra('YCbCr Positioning');
                 case self::REFERENCE_BLACK_WHITE:
                     return Pel::tra('Reference Black/White');
                 case self::RELATED_IMAGE_FILE_FORMAT:
                     return Pel::tra('Related Image File Format');
                 case self::RELATED_IMAGE_WIDTH:
                     return Pel::tra('Related Image Width');
                 case self::RELATED_IMAGE_LENGTH:
                     return Pel::tra('Related Image Length');
//.........这里部分代码省略.........
开发者ID:nao-pon,项目名称:HypCommon,代码行数:101,代码来源:PelTag.php


注:本文中的Pel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。