Skip to content

Commit

Permalink
Prepare version 2.9.1-alpha.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgaillard committed Aug 25, 2016
1 parent 125d55b commit 4191eb3
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ The following builds are available :

## Release history

### 2.9.1-alpha.4 (2016-08-25)
* Add `\Gomoob\MetadataExtractor\Metadata\Photoshop\DuckyDirectory` class.

### 2.9.1-alpha.3 (2016-08-25)
* Add `\Gomoob\MetadataExtractor\Metadata\Bmp\BmpHeaderDescriptor` to begin management of BMP files ;
* Add `\Gomoob\MetadataExtractor\Metadata\Bmp\BmpHeaderDirectory` to begin management of BMP files ;
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "gomoob/php-metadata-extractor",
"description" : "PHP wrapper to easily call the Java metadata-extrator library.",
"version" : "2.9.1-alpha.3",
"version" : "2.9.1-alpha.4",
"license" : "MIT",
"type" : "library",
"keywords" : [
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gomoob-php-metadata-extractor",
"version": "2.9.1-alpha.3",
"version": "2.9.1-alpha.4",
"license": "MIT",
"repository" : {
"type" : "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
use Gomoob\MetadataExtractor\Metadata\Exif\Makernotes\CanonMakernoteDirectory;
use Gomoob\MetadataExtractor\Metadata\Exif\GpsDirectory;
use Gomoob\MetadataExtractor\Metadata\Png\PngDirectory;
use Gomoob\MetadataExtractor\Metadata\Photoshop\DuckyDirectory;

/**
* Reads metadata from any supported file format.
Expand Down Expand Up @@ -685,6 +686,9 @@ private static function createDirectoryWithName($directoryName)
case 'Canon Makernote':
$directory = new CanonMakernoteDirectory();
break;
case 'Ducky':
$directory = new DuckyDirectory();
break;
case 'Exif IFD0':
$directory = new ExifIFD0Directory();
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

/**
* gomoob/php-metadata-extractor
*
* @copyright Copyright (c) 2016, GOMOOB SARL (http://gomoob.com)
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE.md file)
*/
namespace Gomoob\MetadataExtractor\Metadata\Photoshop;

use Gomoob\MetadataExtractor\Metadata\Directory;
use Gomoob\MetadataExtractor\Metadata\TagDescriptor;

/**
* Holds the data found in Photoshop "ducky" segments, created during Save-for-Web.
*
* @author Baptiste GAILLARD ([email protected])
*/
class DuckyDirectory extends Directory
{
const TAG_QUALITY = 1;
const TAG_COMMENT = 2;
const TAG_COPYRIGHT = 3;

private static $tagNameMap = [
self::TAG_QUALITY => 'Quality',
self::TAG_COMMENT => 'Comment',
self::TAG_COPYRIGHT => 'Copyright'
];

public function __construct()
{
$this->setDescriptor(new TagDescriptor($this));
}

/**
* {@inheritDoc}
*/
public function getName()
{
return 'Ducky';
}

/**
* {@inheritDoc}
*/
protected function getTagNameMap()
{
return static::$tagNameMap;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

/**
* Copyright 2016 SARL GOMOOB. All rights reserved.
*/
*/
namespace Gomoob\MetadataExtractor\Imaging\ImageMetadataReader;

use Gomoob\MetadataExtractor\Imaging\ImageMetadataReader;

use PHPUnit\Framework\TestCase;

use Gomoob\MetadataExtractor\Metadata\Exif\ExifIFD0Directory;
use Gomoob\MetadataExtractor\Metadata\Bmp\BmpHeaderDirectory;
use Gomoob\MetadataExtractor\Metadata\File\FileMetadataDirectory;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

/**
* Copyright 2016 SARL GOMOOB. All rights reserved.
*/
namespace Gomoob\MetadataExtractor\Imaging\ImageMetadataReader;

use Gomoob\MetadataExtractor\Imaging\ImageMetadataReader;

use PHPUnit\Framework\TestCase;

use Gomoob\MetadataExtractor\Metadata\Jpeg\JpegDirectory;
use Gomoob\MetadataExtractor\Metadata\Jfif\JfifDirectory;
use Gomoob\MetadataExtractor\Metadata\Photoshop\DuckyDirectory;
use Gomoob\MetadataExtractor\Metadata\Adobe\AdobeJpegDirectory;
use Gomoob\MetadataExtractor\Metadata\File\FileMetadataDirectory;

/**
* Test case used to test the {@link ImageMetadataReader} class with the `spongebob_happy.jpg` test file.
*
* @author Baptiste GAILLARD ([email protected])
* @group ImageMetadataReader.SixteenColor10x10Test
*/
class SpongeBobHappyTest extends TestCase
{
/**
* Test method for {@link ImageMetadataReader#readMetadata($file)} and `spongebob_happy.jpg`.
*/
public function testReadMetadata()
{
$metadata = ImageMetadataReader::readMetadata(realpath(TEST_RESOURCES_DIRECTORY . '/spongebob_happy.jpg'));

// Checks 'JPEG' directory
$directory = $metadata->getDirectories()[0];
$this->assertInstanceOf(JpegDirectory::class, $directory);

// Checks 'JFIF' directory
$directory = $metadata->getDirectories()[1];
$this->assertInstanceOf(JfifDirectory::class, $directory);

// Checks 'Ducky' directory
$directory = $metadata->getDirectories()[2];
$this->assertInstanceOf(DuckyDirectory::class, $directory);

// Checks 'Adobe JPEG' directory
$directory = $metadata->getDirectories()[3];
$this->assertInstanceOf(AdobeJpegDirectory::class, $directory);

// Checks 'File' directory
$directory = $metadata->getDirectories()[4];
$this->assertInstanceOf(FileMetadataDirectory::class, $directory);

// TODO: Continue testing
}
}
Binary file added src/test/resources/spongebob_happy.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4191eb3

Please sign in to comment.