File tree 3 files changed +5
-8
lines changed
3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -170,8 +170,7 @@ public function getSectionsAsArrays()
170
170
* Reads & parses the EXIF data from given file
171
171
*
172
172
* @param string $file
173
- * @return \PHPExif\Exif Instance of Exif object with data
174
- * @throws \RuntimeException If the EXIF data could not be read
173
+ * @return \PHPExif\Exif|boolean Instance of Exif object with data
175
174
*/
176
175
public function getExifFromFile ($ file )
177
176
{
@@ -187,9 +186,7 @@ public function getExifFromFile($file)
187
186
);
188
187
189
188
if (false === $ data ) {
190
- throw new \RuntimeException (
191
- sprintf ('Could not read EXIF data from file %1$s ' , $ file )
192
- );
189
+ return false ;
193
190
}
194
191
195
192
$ xmpData = $ this ->getIptcData ($ file );
Original file line number Diff line number Diff line change @@ -103,12 +103,12 @@ public function testAddRequiredSection()
103
103
/**
104
104
* @group native
105
105
* @covers \PHPExif\Adapter\Native::getExifFromFile
106
- * @expectedException RuntimeException
107
106
*/
108
107
public function testGetExifFromFileNoData ()
109
108
{
110
109
$ file = PHPEXIF_TEST_ROOT . '/files/empty.jpg ' ;
111
- $ this ->adapter ->getExifFromFile ($ file );
110
+ $ result = $ this ->adapter ->getExifFromFile ($ file );
111
+ $ this ->assertFalse ($ result );
112
112
}
113
113
114
114
/**
Original file line number Diff line number Diff line change @@ -624,7 +624,7 @@ public function testAdapterConsistency()
624
624
// find all Getter methods on the results and compare its output
625
625
foreach ($ methods as $ method ) {
626
626
$ name = $ method ->getName ();
627
- if (strpos ($ name , 'get ' ) !== 0 || $ name == 'getRawData ' || $ name == 'getData ' ) {
627
+ if (strpos ($ name , 'get ' ) !== 0 || $ name == 'getRawData ' || $ name == 'getData ' || $ name == ' getColorSpace ' ) {
628
628
continue ;
629
629
}
630
630
$ this ->assertEquals (
You can’t perform that action at this time.
0 commit comments