Boost logo

Boost :

Subject: Re: [boost] Formal Review of IO and Toolbox extensions to Boost.GIL starts TOMORROW
From: Christian Henning (chhenning_at_[hidden])
Date: 2010-12-09 14:10:53

Hi Zach, thanks a lot for review.

> It is generally very good, modulo a few bugs (see below).

What means "modulo a few bugs"?

> There are some specific problems with the tests, though.  For
> instance, png_read_test.cpp takes an image file, reads it, then writes
> it to a temporary file, then re-reads it from the temp file, and
> compares the two read-in images for equality.  This strikes me as a
> bad test.  It is quite possible to read an image, get the wrong
> results, then write those wrong results to disk, re-read them, and
> then have the re-read results compare equal to the original read
> results.  There may be other tests with a similar organization; I did
> not check.

This would assume that both png reader and writer have some bugs in
common. I consider that less probable. This test is not perfect, I
agree, but I cannot just do a byte compare between the original and
copy since the header information might different. If both file have
the exact pixel values, that's a good indicator that writing and
reading does something right.

But I agree with you that testing image writing and reading can be
problematic when the same library is used. Maybe I should use
ImageMagick as the reference reader and my own lib as the writer in
this case.

>> - What is your evaluation of the documentation?
> I was unable to build the docs.  I'm actually surprised that the
> review manager allowed this to go to review without pre-generated,
> web-accessible docs.

I'm working on it. It turns out that building quickbook is too
complicated for me. There are several threads on the boost-user and
boost-build mailing lists to overcome my troubles. In case my proposal
is accepted I'll make sure I can build the documentation before I add
anything to boost.

Sorry for inconvenience.

>> - Did you try to use the extensions? With what compiler? Did you have any problems?
> I only evaluated the PNG loading code, in an existing library that
> already uses (a modified) GIL for image file loading.  My library's
> modified copy of GIL has numerous fixes to the PNG loading code.  When
> I substituted gil.io_new, I found that several files were again
> unreadable.

I just did a quick test with space_elevator.png you mention below.
May it be that you forgot to set the BOOST_GIL_IO_ENABLE_GRAY_ALPHA
symbol? The following code works just fine:


#include <boost/gil/gil_all.hpp>
#include <boost/gil/extension/io_new/png_read.hpp>

using namespace boost;
using namespace gil;

int main()
    gray_alpha8_image_t img;

    read_image( "C:\\chhenning\\zach\\art\\icons\\tech\\space_elevator.png"
              , img
              , png_tag()

    return 0;


Boost list run by bdawes at, gregod at, cpdaniel at, john at