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: RESOLVED OBSOLETE    
Severity: normal CC: jstein, python, sam
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 archtester 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 archtester 2018-08-03 00:08:32 UTC
Created attachment 542204 [details]
emerge --info
Comment 2 Virgil Dupras (RETIRED) 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 archtester 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(+)
Comment 5 David Seifert gentoo-dev 2020-01-26 14:45:45 UTC
Reopen if this persists on 6
Comment 6 ernsteiswuerfel archtester 2020-01-26 22:16:09 UTC
(In reply to David Seifert from comment #5)
> Reopen if this persists on 6
This specific test gets skipped now as jpeg2k got USE-masked meanwhile (/usr/portage/profiles/arch/powerpc/package.use.mask:dev-python/pillow jpeg2k).

But I filed bug #706570 about the tests failing in pillow-7.0.0 on ppc64.
Comment 7 Larry the Git Cow gentoo-dev 2021-03-08 10:39:41 UTC
The bug has been referenced in the following commit(s):

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

commit 879e9cc07d273c915dc39aa4f1c206105b496fd9
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-03-08 10:39:00 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-03-08 10:39:00 +0000

    profiles/arch/powerpc: drop obsolete dev-python/pillow[jpeg2k] mask
    
    It's now a test dependency and it passes on ppc32.
    
    Bug: https://bugs.gentoo.org/662686
    Signed-off-by: Sam James <sam@gentoo.org>

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