@@ -392,40 +392,6 @@ public function testGetOrientation()
392392 $ data [\PHPExif \Exif::ORIENTATION ] = $ expected ;
393393 $ this ->exif ->setRawData ($ data );
394394 $ this ->assertEquals ($ expected , $ this ->exif ->getOrientation ());
395-
396- // test normalization of exiftool strings to raw integer values
397- $ expected = 1 ;
398- $ data [\PHPExif \Exif::ORIENTATION ] = 'Horizontal (normal) ' ;
399- $ this ->exif ->setRawData ($ data );
400- $ this ->assertEquals ($ expected , $ this ->exif ->getOrientation ());
401- $ expected = 2 ;
402- $ data [\PHPExif \Exif::ORIENTATION ] = 'Mirror horizontal ' ;
403- $ this ->exif ->setRawData ($ data );
404- $ this ->assertEquals ($ expected , $ this ->exif ->getOrientation ());
405- $ expected = 3 ;
406- $ data [\PHPExif \Exif::ORIENTATION ] = 'Rotate 180 ' ;
407- $ this ->exif ->setRawData ($ data );
408- $ this ->assertEquals ($ expected , $ this ->exif ->getOrientation ());
409- $ expected = 4 ;
410- $ data [\PHPExif \Exif::ORIENTATION ] = 'Mirror vertical ' ;
411- $ this ->exif ->setRawData ($ data );
412- $ this ->assertEquals ($ expected , $ this ->exif ->getOrientation ());
413- $ expected = 5 ;
414- $ data [\PHPExif \Exif::ORIENTATION ] = 'Mirror horizontal and rotate 270 CW ' ;
415- $ this ->exif ->setRawData ($ data );
416- $ this ->assertEquals ($ expected , $ this ->exif ->getOrientation ());
417- $ expected = 6 ;
418- $ data [\PHPExif \Exif::ORIENTATION ] = 'Rotate 90 CW ' ;
419- $ this ->exif ->setRawData ($ data );
420- $ this ->assertEquals ($ expected , $ this ->exif ->getOrientation ());
421- $ expected = 7 ;
422- $ data [\PHPExif \Exif::ORIENTATION ] = 'Mirror horizontal and rotate 90 CW ' ;
423- $ this ->exif ->setRawData ($ data );
424- $ this ->assertEquals ($ expected , $ this ->exif ->getOrientation ());
425- $ expected = 8 ;
426- $ data [\PHPExif \Exif::ORIENTATION ] = 'Rotate 270 CW ' ;
427- $ this ->exif ->setRawData ($ data );
428- $ this ->assertEquals ($ expected , $ this ->exif ->getOrientation ());
429395 }
430396
431397 /**
@@ -435,25 +401,30 @@ public function testAdapterConsistency()
435401 {
436402 $ reflClass = new \ReflectionClass ('\PHPExif\Exif ' );
437403 $ methods = $ reflClass ->getMethods (ReflectionMethod::IS_PUBLIC );
438- $ file = PHPEXIF_TEST_ROOT . '/files/morning_glory_pool_500.jpg ' ;
404+ $ testfiles = array (
405+ PHPEXIF_TEST_ROOT . '/files/morning_glory_pool_500.jpg ' ,
406+ PHPEXIF_TEST_ROOT . '/files/dsc_5794.jpg '
407+ );
439408
440409 $ adapter_exiftool = new \PHPExif \Reader \Adapter \Exiftool ();
441410 $ adapter_native = new \PHPExif \Reader \Adapter \Native ();
442411
443- $ result_exiftool = $ adapter_exiftool ->getExifFromFile ($ file );
444- $ result_native = $ adapter_native ->getExifFromFile ($ file );
445-
446- // find all Getter methods on the results and compare its output
447- foreach ($ methods as $ method ) {
448- $ name = $ method ->getName ();
449- if (strpos ($ name , 'get ' ) !== 0 || $ name == 'getRawData ' ) {
450- continue ;
412+ foreach ($ testfiles as $ file ) {
413+ $ result_exiftool = $ adapter_exiftool ->getExifFromFile ($ file );
414+ $ result_native = $ adapter_native ->getExifFromFile ($ file );
415+
416+ // find all Getter methods on the results and compare its output
417+ foreach ($ methods as $ method ) {
418+ $ name = $ method ->getName ();
419+ if (strpos ($ name , 'get ' ) !== 0 || $ name == 'getRawData ' ) {
420+ continue ;
421+ }
422+ $ this ->assertEquals (
423+ call_user_func (array ($ result_native , $ name )),
424+ call_user_func (array ($ result_exiftool , $ name )),
425+ 'Adapter difference detected in method " ' . $ name . '" on image " ' . basename ($ file ) . '" '
426+ );
451427 }
452- $ this ->assertEquals (
453- call_user_func (array ($ result_native , $ name )),
454- call_user_func (array ($ result_exiftool , $ name )),
455- 'Adapter difference in method ' . $ name
456- );
457428 }
458429 }
459430}
0 commit comments