Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 662686

Summary: dev-python/pillow-5.2.0: test_16bit_monchrome_j2k_like_tiff FAILED
Product: Gentoo Linux Reporter: ernsteiswuerfel <erhard_f>
Component: Current packagesAssignee: Python Gentoo Team <python>
Status: CONFIRMED ---    
Severity: normal CC: jstein, python
Priority: Normal Keywords: TESTFAILURE
Version: unspecified   
Hardware: PPC64   
OS: Linux   
URL: https://github.com/python-pillow/Pillow/issues/3290
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
emerge --info

Description ernsteiswuerfel 2018-08-03 00:07:12 UTC
Created attachment 542202 [details]
build.log

============================================================= FAILURES =============================================================
________________________________________ TestFileJpeg2k.test_16bit_monchrome_j2k_like_tiff _________________________________________

self = <test_file_jpeg2k.TestFileJpeg2k testMethod=test_16bit_monchrome_j2k_like_tiff>

    def test_16bit_monchrome_j2k_like_tiff(self):
    
        tiff_16bit = Image.open('Tests/images/16bit.cropped.tif')
        j2k = Image.open('Tests/images/16bit.cropped.j2k')
>       self.assert_image_similar(j2k, tiff_16bit, 1e-3)

Tests/test_file_jpeg2k.py:159: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_file_jpeg2k.TestFileJpeg2k testMethod=test_16bit_monchrome_j2k_like_tiff>
a = <PIL.Image.Image image mode=I size=64x64 at 0x3FFF7F6BF390>, b = <PIL.Image.Image image mode=I size=64x64 at 0x3FFF7F6BF250>
epsilon = 0.001, msg = None

    def assert_image_similar(self, a, b, epsilon, msg=None):
        epsilon = float(epsilon)
        self.assertEqual(
            a.mode, b.mode,
            msg or "got mode %r, expected %r" % (a.mode, b.mode))
        self.assertEqual(
            a.size, b.size,
            msg or "got size %r, expected %r" % (a.size, b.size))
    
        a, b = convert_to_comparable(a, b)
    
        diff = 0
        for ach, bch in zip(a.split(), b.split()):
            chdiff = ImageMath.eval("abs(a - b)", a=ach, b=bch).convert('L')
            diff += sum(i * num for i, num in enumerate(chdiff.histogram()))
    
        ave_diff = float(diff)/(a.size[0]*a.size[1])
        try:
            self.assertGreaterEqual(
                epsilon, ave_diff,
                (msg or '') +
                " average pixel value difference %.4f > epsilon %.4f" % (
                    ave_diff, epsilon))
        except Exception as e:
            if HAS_UPLOADER:
                try:
                    url = test_image_results.upload(a, b)
                    logger.error("Url for test images: %s" % url)
                except:
                    pass
>           raise e
E           AssertionError:  average pixel value difference 254.9377 > epsilon 0.0010

Tests/helper.py:154: AssertionError
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================= 1 failed, 269 passed, 5 skipped in 30.07 seconds =========================================
Comment 1 ernsteiswuerfel 2018-08-03 00:08:32 UTC
Created attachment 542204 [details]
emerge --info
Comment 2 Virgil Dupras gentoo-dev 2018-08-04 13:40:51 UTC
Thanks for this test run. On my machine, this test runs fine so I'm thinking that the failure might be arch-specific.

As we can see in bug 659320, pillow is in the process of being rekeyworded and ppc64 arch team hasn't made its test run yet. Is this the only test that fails? Could you try to run it with -jpeg2k to see if it builds/test fine? If yes, we could probably re-keyword ppc64 with only the jpeg2k USE flag masked.

Have you tested it on upstream's master branch? Maybe it would be worth filing a bug upstream.
Comment 3 ernsteiswuerfel 2018-08-05 12:49:32 UTC
I can confirm the tests pass when built with -jpeg2k. 

The test also fails in git-master, so I filed an upgstream bug report as asked: https://github.com/python-pillow/Pillow/issues/3290
Comment 4 Larry the Git Cow gentoo-dev 2019-03-10 16:57:59 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e2137537e1742b24aa365aa2c2d51f3e8481f91a

commit e2137537e1742b24aa365aa2c2d51f3e8481f91a
Author:     Virgil Dupras <vdupras@gentoo.org>
AuthorDate: 2019-03-10 16:56:58 +0000
Commit:     Virgil Dupras <vdupras@gentoo.org>
CommitDate: 2019-03-10 16:56:58 +0000

    profiles/powerpc: mask jpeg2k for dev-python/pillow
    
    Bug: https://bugs.gentoo.org/662686
    Signed-off-by: Virgil Dupras <vdupras@gentoo.org>

 profiles/arch/powerpc/package.use.mask | 4 ++++
 1 file changed, 4 insertions(+)