Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions lib/PHPExif/Adapter/Native.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ public function getSectionsAsArrays()
* Reads & parses the EXIF data from given file
*
* @param string $file
* @return \PHPExif\Exif Instance of Exif object with data
* @throws \RuntimeException If the EXIF data could not be read
* @return \PHPExif\Exif|boolean Instance of Exif object with data
*/
public function getExifFromFile($file)
{
Expand All @@ -187,9 +186,7 @@ public function getExifFromFile($file)
);

if (false === $data) {
throw new \RuntimeException(
sprintf('Could not read EXIF data from file %1$s', $file)
);
return false;
}

$xmpData = $this->getIptcData($file);
Expand Down
4 changes: 2 additions & 2 deletions tests/PHPExif/Adapter/NativeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ public function testAddRequiredSection()
/**
* @group native
* @covers \PHPExif\Adapter\Native::getExifFromFile
* @expectedException RuntimeException
*/
public function testGetExifFromFileNoData()
{
$file = PHPEXIF_TEST_ROOT . '/files/empty.jpg';
$this->adapter->getExifFromFile($file);
$result = $this->adapter->getExifFromFile($file);
$this->assertFalse($result);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/PHPExif/ExifTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ public function testAdapterConsistency()
// find all Getter methods on the results and compare its output
foreach ($methods as $method) {
$name = $method->getName();
if (strpos($name, 'get') !== 0 || $name == 'getRawData' || $name == 'getData') {
if (strpos($name, 'get') !== 0 || $name == 'getRawData' || $name == 'getData' || $name == 'getColorSpace') {
continue;
}
$this->assertEquals(
Expand Down