On Oct 31, 2009, at 1:48 PM, Ralf Gommers wrote:
The last commit adds a test of the function `palette_is_gray`. Unfortunately, the test is a bit ugly. First, I had to add an import of PIL in the test, since palette_is_gray works specifically on PIL palette images. Second, I had to add `palette_is_grayscale` to __all__ in pil_imread so that I could use the function in my test. (Python documentation suggests that __all__ only affects ``from <> import *``, but it seemed to prevent ``from scikits.image.io import palette_is_grayscale``.)
The PIL import is fine, but the try-except block is unnecessary since that is already done in imread.
Adding to __all__ is not necessary, you can import it from io.pil_imread.
Ahh, of course.
I did notice that other imread tests fail already if PIL is not available. For this we do need an @pil_skip decorator I think.
Let me know what you think of the tests. Also, should I do a pull request?
Looks good overall. I made some minor changes reflecting the comments I made above: http://github.com/rgommers/scikits.image/commit/a6ad7415d7a43185cea898d3454e...
If you are happy with those, you can pull my palette branch over and send Stefan a pull request.
The changes look good. Thanks! Pull request sent. Thanks, -Tony