From: Enblend <enb...@li...> - 2015-08-07 14:46:38
|
branch: stable-4_1 details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/3374d148d5aa changeset: 1265:3374d148d5aa user: Chris <cs...@us...> date: Fri Aug 07 16:45:00 2015 +0200 description: Test whether Vigra can handle an image right after we have ensured that it can be opened. This check catches several kinds of incompatibility problems like libtiff not handling BigTIFF before we find ourselves between a rock and a hard place. Ported from the Development Branch, rev 2d2d3a8e1d47. diffstat: VERSION | 2 +- src/enblend.cc | 14 ++++++++++++++ src/enfuse.cc | 14 ++++++++++++++ src/tiff_message.cc | 3 +-- 4 files changed, 30 insertions(+), 3 deletions(-) diffs (67 lines): diff -r 03aedde5c12a -r 3374d148d5aa VERSION --- a/VERSION Fri Aug 07 16:44:58 2015 +0200 +++ b/VERSION Fri Aug 07 16:45:00 2015 +0200 @@ -1,1 +1,1 @@ -4.1.4-9b23575b0e66 +4.1.4-03aedde5c12a diff -r 03aedde5c12a -r 3374d148d5aa src/enblend.cc --- a/src/enblend.cc Fri Aug 07 16:44:58 2015 +0200 +++ b/src/enblend.cc Fri Aug 07 16:45:00 2015 +0200 @@ -1845,6 +1845,20 @@ i->unroll_trace(); exit(1); } + + if (!vigra::isImage(i->filename().c_str())) { + std::cerr << + command << ": cannot process \"" << i->filename() << "\"; not recognized as an image\n" << + command << ": info: possible causes:\n" << + command << ": info: - An underlying image-processing library does not understand the\n" << + command << ": info: particular compression, sub-format, format extension, ...\n" << + command << ": info: - Enblend was not compiled with support for this format, which\n" << + command << ": info: can be checked with \"" << command << " --show-image-formats\".\n" << + command << ": info: - The image is corrupted or it is incomplete/truncated.\n" << + command << ": info: - It really is not an image. Honesty, huh?\n"; + i->unroll_trace(); + exit(1); + } } LayerSelection.retrieve_image_information(inputTraceableFileNameList.begin(), diff -r 03aedde5c12a -r 3374d148d5aa src/enfuse.cc --- a/src/enfuse.cc Fri Aug 07 16:44:58 2015 +0200 +++ b/src/enfuse.cc Fri Aug 07 16:45:00 2015 +0200 @@ -1836,6 +1836,20 @@ i->unroll_trace(); exit(1); } + + if (!vigra::isImage(i->filename().c_str())) { + std::cerr << + command << ": cannot process \"" << i->filename() << "\"; not recognized as an image\n" << + command << ": info: possible causes:\n" << + command << ": info: - An underlying image-processing library does not understand the\n" << + command << ": info: particular compression, sub-format, format extension, ...\n" << + command << ": info: - Enfuse was not compiled with support for this format, which\n" << + command << ": info: can be checked with \"" << command << " --show-image-formats\".\n" << + command << ": info: - The image is corrupted or it is incomplete/truncated.\n" << + command << ": info: - It really is not an image. Honesty, huh?\n"; + i->unroll_trace(); + exit(1); + } } LayerSelection.retrieve_image_information(inputTraceableFileNameList.begin(), diff -r 03aedde5c12a -r 3374d148d5aa src/tiff_message.cc --- a/src/tiff_message.cc Fri Aug 07 16:44:58 2015 +0200 +++ b/src/tiff_message.cc Fri Aug 07 16:45:00 2015 +0200 @@ -19,8 +19,7 @@ */ -#include <stdio.h> - +#include <cstdio> // fflush(), vsnprintf() #include <cstring> #include <iostream> #include <set> |