Commit 48f8b35b authored by André Anjos's avatar André Anjos 💬

Closes issue #20

parent 1976c524
Pipeline #3686 passed with stages
in 49 minutes and 8 seconds
......@@ -281,9 +281,13 @@ QuantizeBuffer(unsigned int Width, unsigned int Height, int *ColorMapSize,
#endif // End of ugly QuantizeBuffer definition for giflib 4.2
static void GifErrorHandler(const char* fname, int error) {
#if defined(GIF_LIB_VERSION) || (GIFLIB_MAJOR < 5)
const char* error_string = GifErrorString(error);
boost::format m("GIF: error in %s(): %s");
m % fname;
#else
const char* error_string = "unknown error (giflib < 5)";
#endif
boost::format m("GIF: error in %s(): (%d) %s");
m % fname % error;
if (error_string) m % error_string;
else m % "unknown error";
throw std::runtime_error(m.str());
......@@ -298,7 +302,8 @@ static int DGifDeleter (GifFileType* ptr) {
if (retval == GIF_ERROR) {
//do not call GifErrorHandler here, or the interpreter will crash
const char* error_string = GifErrorString(retval);
boost::format m("In DGifCloseFile(): %s");
boost::format m("In DGifCloseFile(): (%d) %s");
m % error;
if (error_string) m % error_string;
else m % "unknown error";
std::cerr << "ERROR: " << m.str() << std::endl;
......@@ -334,7 +339,8 @@ static int EGifDeleter (GifFileType* ptr) {
if (retval == GIF_ERROR) {
//do not call GifErrorHandler here, or the interpreter will crash
const char* error_string = GifErrorString(error);
boost::format m("In EGifCloseFile(): %s");
boost::format m("In EGifCloseFile(): (%d) %s");
m % error;
if (error_string) m % error_string;
else m % "unknown error";
std::cerr << "ERROR: " << m.str() << std::endl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment