From 63cfbadc9589152ba3ccd1d656b27b79864d3a42 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 20 Apr 2011 17:15:58 +0000 Subject: [PATCH] From Guillaume Taze, "This is a fix for the error popups which appeared when reading a corrupted file on windows. Errors are redirected to std::err instead." Note from Robert Osfield, changed jpeg error report output from stderr to standard OSG notification system using OSG_WARN. --- src/osgPlugins/jpeg/ReaderWriterJPEG.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp b/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp index 29fbf819d..d71b2547d 100644 --- a/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp +++ b/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp @@ -429,6 +429,17 @@ my_error_exit (j_common_ptr cinfo) longjmp(myerr->setjmp_buffer, 1); } +static void +my_output_message (j_common_ptr cinfo) +{ + char buffer[JMSG_LENGTH_MAX]; + + /* Create the message */ + (*cinfo->err->format_message) (cinfo, buffer); + + OSG_WARN<