File tree Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -170,8 +170,7 @@ public function getSectionsAsArrays()
170170 * Reads & parses the EXIF data from given file
171171 *
172172 * @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
175174 */
176175 public function getExifFromFile ($ file )
177176 {
@@ -187,9 +186,7 @@ public function getExifFromFile($file)
187186 );
188187
189188 if (false === $ data ) {
190- throw new \RuntimeException (
191- sprintf ('Could not read EXIF data from file %1$s ' , $ file )
192- );
189+ return false ;
193190 }
194191
195192 $ xmpData = $ this ->getIptcData ($ file );
Original file line number Diff line number Diff line change @@ -103,12 +103,12 @@ public function testAddRequiredSection()
103103 /**
104104 * @group native
105105 * @covers \PHPExif\Adapter\Native::getExifFromFile
106- * @expectedException RuntimeException
107106 */
108107 public function testGetExifFromFileNoData ()
109108 {
110109 $ file = PHPEXIF_TEST_ROOT . '/files/empty.jpg ' ;
111- $ this ->adapter ->getExifFromFile ($ file );
110+ $ result = $ this ->adapter ->getExifFromFile ($ file );
111+ $ this ->assertFalse ($ result );
112112 }
113113
114114 /**
Original file line number Diff line number Diff line change @@ -624,7 +624,7 @@ public function testAdapterConsistency()
624624 // find all Getter methods on the results and compare its output
625625 foreach ($ methods as $ method ) {
626626 $ 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 ' ) {
628628 continue ;
629629 }
630630 $ this ->assertEquals (
You can’t perform that action at this time.
0 commit comments