---
milena/ChangeLog | 4 ++++
milena/mln/io/pdf/load.hh | 6 ++++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index a14bc8a..86b2a92 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,9 @@
2013-03-01 Guillaume Lazzara <z(a)lrde.epita.fr>
+ * mln/io/pdf/load.hh: Check if the PDF can be rendered.
+
+2013-03-01 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Add test images.
* tests/img/example-0.ppm,
diff --git a/milena/mln/io/pdf/load.hh b/milena/mln/io/pdf/load.hh
index 513a61d..ee68c8a 100644
--- a/milena/mln/io/pdf/load.hh
+++ b/milena/mln/io/pdf/load.hh
@@ -198,6 +198,12 @@ namespace mln
// Render Page
poppler::page_renderer pr;
+ if (! pr.can_render())
+ {
+ std::cout << "PDF cannot be rendered! Make sure libpoppler is "
+ << "compiled with a render backend." << std::endl;
+ abort();
+ }
poppler::image pima = pr.render_page(p, dpi, dpi);
// Prepare MLN image.
--
1.7.2.5
Show replies by date