Page MenuHomePhabricator

ExifRotationTest test fails on PHP 7.2
Closed, ResolvedPublic

Description

1) ExifRotationTest::testMetadata with data set #1 ('portrait-rotated.jpg', 'image/jpeg', array(768, 1024), array(array(450, 600), array(600, 800), array(800, 1067), array(600, 800)))
portrait-rotated.jpg: width check
Failed asserting that 1024 matches expected 768.
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/media/ExifRotationTest.php:42
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:420
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
2) ExifRotationTest::testMetadataAutoRotate with data set #1 ('portrait-rotated.jpg', 'image/jpeg', array(768, 1024), array(array(450, 600), array(600, 800), array(800, 1067), array(600, 800)))
portrait-rotated.jpg: width check
Failed asserting that 1024 matches expected 768.
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/media/ExifRotationTest.php:59
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:420
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
3) ExifRotationTest::testRotationRendering with data set #1 ('portrait-rotated.jpg', 'image/jpeg', array(768, 1024), array(array(450, 600), array(600, 800), array(800, 1067), array(600, 800)))
portrait-rotated.jpg: thumb reported width check for 800x600px
Failed asserting that 800.0 matches expected 450.
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/media/ExifRotationTest.php:91
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:420
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Krinkle renamed this task from More file related test failures on PHP 7.2 to MediaHandler test fails on PHP 7.2 (BitmapMetadataHandlerTest, ExifRotationTest, GIFHandlerTest, PNGHandlerTest).Apr 6 2018, 2:28 AM
Krinkle updated the task description. (Show Details)
Reedy renamed this task from MediaHandler test fails on PHP 7.2 (BitmapMetadataHandlerTest, ExifRotationTest, GIFHandlerTest, PNGHandlerTest) to ExifRotationTest test fails on PHP 7.2.Jun 9 2018, 2:45 AM
Reedy updated the task description. (Show Details)
Reedy updated the task description. (Show Details)

Doesn't fail for me anymore, can you confirm @Reedy?

I can still replicate...

reedy@ubuntu64-web-esxi:/var/www/wiki/mediawiki/core/tests/phpunit$ php phpunit.php includes/media/ExifRotationTest.php 
#!/usr/bin/env php
Using PHP 7.2.7-0ubuntu0.18.04.2
PHPUnit 6.5.9 by Sebastian Bergmann and contributors.

.F.F.F............                                                18 / 18 (100%)

Time: 10.66 seconds, Memory: 52.25MB

There were 3 failures:

1) ExifRotationTest::testMetadata with data set #1 ('portrait-rotated.jpg', 'image/jpeg', array(768, 1024), array(array(450, 600), array(600, 800), array(800, 1067), array(600, 800)))
portrait-rotated.jpg: width check
Failed asserting that 1024 matches expected 768.

/var/www/wiki/mediawiki/core/tests/phpunit/includes/media/ExifRotationTest.php:42
/var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:469
/var/www/wiki/mediawiki/core/maintenance/doMaintenance.php:94

2) ExifRotationTest::testMetadataAutoRotate with data set #1 ('portrait-rotated.jpg', 'image/jpeg', array(768, 1024), array(array(450, 600), array(600, 800), array(800, 1067), array(600, 800)))
portrait-rotated.jpg: width check
Failed asserting that 1024 matches expected 768.

/var/www/wiki/mediawiki/core/tests/phpunit/includes/media/ExifRotationTest.php:59
/var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:469
/var/www/wiki/mediawiki/core/maintenance/doMaintenance.php:94

3) ExifRotationTest::testRotationRendering with data set #1 ('portrait-rotated.jpg', 'image/jpeg', array(768, 1024), array(array(450, 600), array(600, 800), array(800, 1067), array(600, 800)))
portrait-rotated.jpg: thumb reported width check for 800x600px
Failed asserting that 800.0 matches expected 450.

/var/www/wiki/mediawiki/core/tests/phpunit/includes/media/ExifRotationTest.php:91
/var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:469
/var/www/wiki/mediawiki/core/maintenance/doMaintenance.php:94

FAILURES!
Tests: 18, Assertions: 105, Failures: 3.
reedy@ubuntu64-web-esxi:/var/www/wiki/mediawiki/core/tests/phpunit$

Bleh, it was skipping for me because my homebuilt PHP was missing exif...

Tried reproducing your environment:

max@vmubuntu:/var/www/html/w/tests/phpunit$ php phpunit.php includes/media/ExifRotationTest.php 
Using PHP 7.2.7-0ubuntu0.18.04.2
PHPUnit 6.5.9 by Sebastian Bergmann and contributors.

..................                                                18 / 18 (100%)

Time: 3.52 seconds, Memory: 26.00MB

OK (18 tests, 122 assertions)
max@vmubuntu:/var/www/html/w/tests/phpunit$ php --version
PHP 7.2.7-0ubuntu0.18.04.2 (cli) (built: Jul  4 2018 16:55:24) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.7-0ubuntu0.18.04.2, Copyright (c) 1999-2018, by Zend Technologies
max@vmubuntu:/var/www/html/w/tests/phpunit$ php -i | grep -i exif
/etc/php/7.2/cli/conf.d/20-exif.ini,
exif
EXIF Support => enabled
EXIF Version => 7.2.7-0ubuntu0.18.04.2
Supported EXIF Version => 0220
Extended EXIF tag formats => Canon, Casio, Fujifilm, Nikon, Olympus, Samsung, Panasonic, DJI, Sony, Pentax, Minolta, Sigma, Foveon, Kyocera, Ricoh, AGFA, Epson
exif.decode_jis_intel => JIS => JIS
exif.decode_jis_motorola => JIS => JIS
exif.decode_unicode_intel => UCS-2LE => UCS-2LE
exif.decode_unicode_motorola => UCS-2BE => UCS-2BE
exif.encode_jis => no value => no value
exif.encode_unicode => ISO-8859-15 => ISO-8859-15

@Reedy can you still reproduce? This is not failing on travis-ci nor jenkins.

Legoktm changed the task status from Open to Stalled.Oct 13 2018, 6:53 AM

LGTM too

reedy@ubuntu64-web-esxi:/var/www/wiki/mediawiki/core/tests/phpunit$ php phpunit.php includes/media/ExifRotationTest.php 
#!/usr/bin/env php
Using PHP 7.2.10-0ubuntu0.18.04.1
PHPUnit 6.5.13 by Sebastian Bergmann and contributors.

..................                                                18 / 18 (100%)

Time: 15.27 seconds, Memory: 52.25MB

OK (18 tests, 122 assertions)
Reedy claimed this task.