* mln/io/pdf/load.hh,
* mln/io/tiff/load.hh:
Here.
---
milena/ChangeLog | 8 ++++++++
milena/mln/io/pdf/load.hh | 8 ++++----
milena/mln/io/tiff/load.hh | 10 +++++-----
3 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index ef4a090..8e8dbcc 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,13 @@
2013-08-27 Roland Levillain <roland(a)lrde.epita.fr>
+ Display Milena fatal errors on std::cerr, not std::cout.
+
+ * mln/io/pdf/load.hh,
+ * mln/io/tiff/load.hh:
+ Here.
+
+2013-08-27 Roland Levillain <roland(a)lrde.epita.fr>
+
Remove Milena debug code making side effects on streams.
* mln/accu/stat/median_alt.hh,
diff --git a/milena/mln/io/pdf/load.hh b/milena/mln/io/pdf/load.hh
index 84e0926..9fed1f4 100644
--- a/milena/mln/io/pdf/load.hh
+++ b/milena/mln/io/pdf/load.hh
@@ -201,7 +201,7 @@ namespace mln
{
case poppler::image::format_invalid:
case poppler::image::format_mono:
- std::cout << "Loading black and white pdf is not implemented!";
+ std::cerr << "Loading black and white pdf is not implemented!";
abort();
break;
case poppler::image::format_rgb24:
@@ -225,7 +225,7 @@ namespace mln
poppler::page_renderer pr;
if (! pr.can_render())
{
- std::cout << "PDF cannot be rendered! Make sure libpoppler is "
+ std::cerr << "PDF cannot be rendered! Make sure libpoppler is "
<< "compiled with a render backend." << std::endl;
abort();
}
@@ -282,7 +282,7 @@ namespace mln
if (first_page < 0 || first_page > (pdf->pages() - 1)
|| last_page < 0 || last_page > (pdf->pages() - 1))
{
- std::cout << "Error while loading PDF: page range is not correct!"
+ std::cerr << "Error while loading PDF: page range is not correct!"
<< std::endl;
abort();
}
@@ -313,7 +313,7 @@ namespace mln
{
if (pages[i] < 0 || pages[i] > pdf->pages() - 1)
{
- std::cout << "Error while loading PDF: selected page "
+ std::cerr << "Error while loading PDF: selected page "
<< pages[i] << " does not exist!" << std::endl;
abort();
}
diff --git a/milena/mln/io/tiff/load.hh b/milena/mln/io/tiff/load.hh
index 2fabcd9..c175459 100644
--- a/milena/mln/io/tiff/load.hh
+++ b/milena/mln/io/tiff/load.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009, 2012 EPITA Research and Development Laboratory
+// Copyright (C) 2009, 2012, 2013 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of Olena.
@@ -156,7 +156,7 @@ namespace mln
uint16 data_size = bits_per_sample * samples_per_pixel;
if (data_size != 24 && data_size != 32)
{
- std::cout << "Trying to load a non color TIFF "
+ std::cerr << "Trying to load a non color TIFF "
<< "image into a color Milena image." << std::endl;
abort();
}
@@ -166,7 +166,7 @@ namespace mln
if (!TIFFReadRGBAImage(file, ima.ncols(), ima.nrows(), raster, 0))
{
- std::cout << "Error while reading the image file. Is it corrupted?"
+ std::cerr << "Error while reading the image file. Is it corrupted?"
<< std::endl;
abort();
}
@@ -231,7 +231,7 @@ namespace mln
TIFFGetField(file, TIFFTAG_SAMPLESPERPIXEL, &samples_per_pixel);
if (samples_per_pixel != 1)
{
- std::cout << "Trying to load a non grayscale TIFF "
+ std::cerr << "Trying to load a non grayscale TIFF "
<< "image into a grayscale Milena image." << std::endl;
abort();
}
@@ -241,7 +241,7 @@ namespace mln
if (!TIFFReadRGBAImage(file, ima.ncols(), ima.nrows(), raster, 0))
{
- std::cout << "Error while reading the image file. Is it corrupted?"
+ std::cerr << "Error while reading the image file. Is it corrupted?"
<< std::endl;
abort();
}
--
1.7.10.4
Show replies by date