Changed ComputeStatistics to use bool rather than int to fix error.

#15 Merged at efbf701
Deleted repository
default (efbf7012e473)
  1. Daniel Clewley

Fixes error in the latest conda-forge build of TuiView under Linux where opening a file without pre-computed statistics results in the following error.

in method 'Band_ComputeStatistics', argument 2 of type bool

Tested with GDAL 2.1.3 and fixes error. Also tested with 1.11.3 and 1.11.1 and didn't cause any problems.

Would be good for someone else to try and reproduce the problem / solution before this is merged.

Comments (4)

  1. Sam Gillingham

    Thanks Dan. Do you have a small file you can attach to this (or email to me) that would reproduce this?

    I'm away for a few days but will look into this when I get back.

  2. Daniel Clewley author

    You should be able to reproduce with any file which doesn't have stats pre-computed. You can try with the one of the files in the RSGISLib tests:

    # Create ENVI file
    gdal_translate -of ENVI injune_p142_casi_sub_utm.kea /tmp/injune_p142_casi_sub_utm.bsq
    # Remove aux.xml file (might contain stats)
    rm /tmp/injune_p142_casi_sub_utm.bsq.aux.xml
    # Open in TuiView
    tuiview /tmp/injune_p142_casi_sub_utm.bsq

    This gives the error under Linux and macOS for me which this change fixes.