On Friday 12 December 2003 16:47, Jean-Sebastien Mouret wrote:
Michal Lijowski <michal(a)cvu.wustl.edu> writes:
[..]
By the way, olena's io used to be more expressive. Applying the below
patch should prevent this kind of disappointment. I really don't know
why this line has been commented out, maybe because it is a bit
annoying when using olena in a python shell (as it may have its own
error reporting).
Having Olena logging systematically on clog can disturb the normal output of
the calling program (which may itself use clog for another reason). That's
why I don't think uncontrolled verbosity should be kept. We should have
something more sophisticated for debug, which can be parameterized by the
calling program (levels of verbosity, stream on which log should be written,
etc.). This is in the TODO list ... :)
demo/tour.cc should check image loading success before continuing though, as
one would have done with C++ streams, using the image::has_impl() method.
Index: doc/demo/tour.cc
--- doc/demo/tour.cc Tue, 13 May 2003 22:55:53 +0200 burrus_n (oln/
d/45_tour.cc 1.12 640)
+++ doc/demo/tour.cc Fri, 12 Dec 2003 17:19:13 +0100 burrus_n (oln/
d/45_tour.cc 1.12 640)
@@ -330,6 +330,11 @@
// the type of the image you load/save. The extension
// is also used to guess the format to use.
image2d<int_u8> lena = load(IMGDIR "/lena.pgm");
+ if (!lena.has_impl())
+ {
+ std::cerr << "Could not load " << IMGDIR
"/lena.pgm" << std::endl;
+ exit(1);
+ }
std::cout << "watershedling lena..." << std::endl;
save(morpho::watershed_seg<int_u8>(lena, neighb_c4()), "output.pgm");