Skip to content

Commit cc31d78

Browse files
committed
Merge pull request #29 from Miljar/rel/v0.3.0
Rel/v0.3.0
2 parents 9f6afbe + 61002d4 commit cc31d78

File tree

11 files changed

+154
-43
lines changed

11 files changed

+154
-43
lines changed

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ after_script:
2424

2525
before_install:
2626
- composer self-update
27-
- wget http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-9.82.tar.gz
28-
- tar -zxvf Image-ExifTool-9.82.tar.gz
29-
- cd Image-ExifTool-9.82 && perl Makefile.PL && make test && sudo make install
30-
- cd .. && rm -rf Image-ExifTool-9.82
27+
- wget http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-9.90.tar.gz
28+
- tar -zxvf Image-ExifTool-9.90.tar.gz
29+
- cd Image-ExifTool-9.90 && perl Makefile.PL && make test && sudo make install
30+
- cd .. && rm -rf Image-ExifTool-9.90

CHANGELOG.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CHANGELOG
2+
=====
3+
4+
0.3.0
5+
-----
6+
7+
* Bugfix `#24`_: getRawData() does not return raw EXIF data
8+
* Bugfix `#18`_: Create CHANGELOG
9+
* Separated ``Adapter`` & ``Reader`` classes
10+
* Created ``ReaderInterface`` class
11+
* BC-break `#15`_: Exiftool adapter: add -n switch to exiftool call
12+
* Composer.json: added semver version for phpmd; removed pdepend
13+
* added ``Orientation``, ``MimeType``, ``FileSize`` and ``ColorSpace`` options to EXIF
14+
15+
.. _`#24`: https://github.com/Miljar/php-exif/issues/24
16+
.. _`#18`: https://github.com/Miljar/php-exif/issues/18
17+
.. _`#15`: https://github.com/Miljar/php-exif/issues/15

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [PHPExif v0.2.1](http://github.com/Miljar/php-exif) [![Build Status](https://travis-ci.org/Miljar/php-exif.png?branch=master)](https://travis-ci.org/Miljar/php-exif) [![Coverage Status](https://coveralls.io/repos/Miljar/php-exif/badge.svg?branch=v0.2.2)](https://coveralls.io/r/Miljar/php-exif?branch=v0.2.2)
1+
# [PHPExif v0.3.0](http://github.com/Miljar/php-exif) [![Build Status](https://travis-ci.org/Miljar/php-exif.png?branch=master)](https://travis-ci.org/Miljar/php-exif) [![Coverage Status](https://coveralls.io/repos/Miljar/php-exif/badge.svg?branch=master)](https://coveralls.io/r/Miljar/php-exif?branch=master)
22

33
PHPExif is a library which gives you easy access to the EXIF meta-data of an image.
44

@@ -7,33 +7,40 @@ PHPExif serves as a wrapper around some native or CLI tools which access this EX
77
## Supported tools
88

99
* Native PHP functionality (exif_read_data, iptcparse)
10-
* [Exiftool](http://www.sno.phy.queensu.ca/~phil/exiftool) adapter (wrapper for the exiftool binary)
10+
* [Exiftool](http://www.sno.phy.queensu.ca/~phil/exiftool) adapter (wrapper for the exiftool binary)
1111

1212
## Installation (composer)
1313

1414
```json
15-
"miljar/php-exif": "~0.2"
15+
"miljar/php-exif": "~0.3.0"
1616
```
1717

1818

1919
## Usage
2020

21-
[Before v0.2.2](Resources/doc/usage_0.2.1.md)
21+
[Before v0.3.0](Resources/doc/usage_0.2.1.md)
2222

23-
[v0.2.2+](Resources/doc/usage.md)
23+
[v0.3.0+](Resources/doc/usage.md)
2424

2525
## Contributing
2626

2727
Please submit all pull requests against the correct branch. The release branch for the next version is a branch with the same name as the next version. Bugfixes should go in the master branch, unless they are for code in a new release branch.
2828

29-
PHPExif is written according the [PSR-0/1/2 standards](http://www.php-fig.org/). When submitting code, please make sure it is conform these standards.
29+
PHPExif is written according the [PSR-0/1/2 standards](http://www.php-fig.org/). When submitting code, please make sure it is conform these standards.
3030

3131
All contributions are welcomed and greatly appreciated.
3232

3333
## Feedback
3434

3535
Have a bug or a feature request? [Please open a new issue](https://github.com/Miljar/php-exif/issues). Before opening any issue, please search for existing issues.
3636

37+
## Contributors
38+
39+
* [Tom Van Herreweghe](http://github.com/Miljar)
40+
* [Ingewikkeld](https://github.com/Ingewikkeld)
41+
* [Christophe Singer](https://github.com/wasinger)
42+
* [Hanov Ruslan](https://github.com/hanovruslan)
43+
3744
## License
3845

3946
[MIT License](http://github.com/Miljar/php-exif/blob/master/LICENSE)

lib/PHPExif/Adapter/Exiftool.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ public function getExifFromFile($file)
108108
$data = json_decode($result, true);
109109
$mappedData = $this->mapData(reset($data));
110110
$exif = new Exif($mappedData);
111+
$exif->setRawData(reset($data));
111112

112113
return $exif;
113114
}

lib/PHPExif/Adapter/Native.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ public function getExifFromFile($file)
191191
$data = array_merge($data, array(self::SECTION_IPTC => $xmpData));
192192
$mappedData = $this->mapData($data);
193193
$exif = new Exif($mappedData);
194+
$exif->setRawData($data);
194195

195196
return $exif;
196197
}

lib/PHPExif/Exif.php

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,31 +49,38 @@ class Exif
4949
const WIDTH = 'width';
5050

5151
/**
52-
* The EXIF data
52+
* The mapped EXIF data
5353
*
5454
* @var array
5555
*/
5656
protected $data = array();
5757

58+
/**
59+
* The raw EXIF data
60+
*
61+
* @var array
62+
*/
63+
protected $rawData = array();
64+
5865
/**
5966
* Class constructor
6067
*
6168
* @param array $data
6269
*/
6370
public function __construct(array $data = array())
6471
{
65-
$this->setRawData($data);
72+
$this->setData($data);
6673
}
6774

6875
/**
69-
* Sets the EXIF data
76+
* Sets the raw EXIF data
7077
*
7178
* @param array $data The data to set
7279
* @return \PHPExif\Exif Current instance for chaining
7380
*/
7481
public function setRawData(array $data)
7582
{
76-
$this->data = $data;
83+
$this->rawData = $data;
7784

7885
return $this;
7986
}
@@ -84,6 +91,29 @@ public function setRawData(array $data)
8491
* @return array
8592
*/
8693
public function getRawData()
94+
{
95+
return $this->rawData;
96+
}
97+
98+
/**
99+
* Sets the mapped EXIF data
100+
*
101+
* @param array $data The data to set
102+
* @return \PHPExif\Exif Current instance for chaining
103+
*/
104+
public function setData(array $data)
105+
{
106+
$this->data = $data;
107+
108+
return $this;
109+
}
110+
111+
/**
112+
* Returns the mapped EXIF data
113+
*
114+
* @return array
115+
*/
116+
public function getData()
87117
{
88118
return $this->data;
89119
}

tests/PHPExif/Reader/Adapter/ExiftoolTest.php renamed to tests/PHPExif/Adapter/ExiftoolTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ public function testGetExifFromFile()
6969
$file = PHPEXIF_TEST_ROOT . '/files/morning_glory_pool_500.jpg';
7070
$result = $this->adapter->getExifFromFile($file);
7171
$this->assertInstanceOf('\PHPExif\Exif', $result);
72+
$this->assertInternalType('array', $result->getRawData());
73+
$this->assertNotEmpty($result->getRawData());
7274
}
7375

7476
/**

tests/PHPExif/Reader/Adapter/NativeTest.php renamed to tests/PHPExif/Adapter/NativeTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ public function testGetExifFromFileHasData()
117117
$file = PHPEXIF_TEST_ROOT . '/files/morning_glory_pool_500.jpg';
118118
$result = $this->adapter->getExifFromFile($file);
119119
$this->assertInstanceOf('\PHPExif\Exif', $result);
120+
$this->assertInternalType('array', $result->getRawData());
121+
$this->assertNotEmpty($result->getRawData());
120122
}
121123

122124
/**

0 commit comments

Comments
 (0)