emcconville / wand

The ctypes-based simple ImageMagick binding for Python
http://docs.wand-py.org/
Other
1.4k stars 197 forks source link

test_forward_fourier_transform and test_inverse_fourier_transform fail in certain conditions #476

Closed sbraz closed 4 years ago

sbraz commented 4 years ago

Hi again, I'm not sure what the problem is but both these tests fail on ArchLinux (ImageMagick 7.0.10-11, Python 3.8) and Gentoo (ImageMagick 7.0.10-9, Python 3.7 and 3.8):

_________________________________________________________________________________________ test_forward_fourier_transform __________________________________________________________________________________________

    @mark.fft                                                                                            
    def test_forward_fourier_transform():                                                                
        with Image(filename='rose:') as img:                                                                                                                                                                       
            was = img.signature                                                                                                                                                                                    
            img.forward_fourier_transform()                                                                                                                                                                        
>           assert was != img.signature                                                                                                                                                                            
E           AssertionError: assert 'fb6fc68beb3b1001c5ebaa671c8ac8fddea06995027127765ff508f77723cc52' != 'fb6fc68beb3b1001c5ebaa671c8ac8fddea06995027127765ff508f77723cc52'
E            +  where 'fb6fc68beb3b1001c5ebaa671c8ac8fddea06995027127765ff508f77723cc52' = <wand.image.Image: fb6fc68 'PNM' (70x46)>.signature                                                                     

tests/image_methods_test.py:877: AssertionError                                                                                                                                                                    
_________________________________________________________________________________________ test_inverse_fourier_transform __________________________________________________________________________________________

fx_asset = local('/wand/tests/assets')                                                                   

    @mark.fft                                                                                                                                                                                                      
    def test_inverse_fourier_transform(fx_asset):
        with Image(filename=str(fx_asset.join('ccobject_magnitude.png'))) as a:                          
            was = a.signature                                                                                                                                                                                      
            with Image(filename=str(fx_asset.join('ccobject_phase.png'))) as b:
                a.inverse_fourier_transform(b)                                                           
>           assert was != a.signature                                                                    
E           AssertionError: assert '88ae31dd75e2ab2cdaab20ad16d9618b09a2e4cf2ad98e5257dbb3121f04d850' != '88ae31dd75e2ab2cdaab20ad16d9618b09a2e4cf2ad98e5257dbb3121f04d850'                                        
E            +  where '88ae31dd75e2ab2cdaab20ad16d9618b09a2e4cf2ad98e5257dbb3121f04d850' = <wand.image.Image: 88ae31d 'PNG' (26x26)>.signature                                                                     

Do you think this is fixable?

emcconville commented 4 years ago

Mostly likely do to fft library not being installed/linked to ImageMagick. Run identify -version and see if fftw is listed as a Delegates.

You can skip fft tests with --skip-fft flag

sbraz commented 4 years ago

Absolutely, it is built without fftw support, I didn't notice that. I guess I will simply skip those tests. Thanks for the quick reply!