From: Udi F. <udi...@us...> - 2006-08-04 22:35:15
|
Update of /cvsroot/ufraw/ufraw In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv10559 Modified Files: dcraw_api.cc ufraw_exiv2.cc Log Message: Fix log messages and redirect exiv2 warnings from stderr to the log. Index: dcraw_api.cc =================================================================== RCS file: /cvsroot/ufraw/ufraw/dcraw_api.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dcraw_api.cc 30 Jul 2006 16:56:58 -0000 1.1 --- dcraw_api.cc 4 Aug 2006 22:35:12 -0000 1.2 *************** *** 449,457 **** void dcraw_message(void *dcraw, int code, char *format, ...) { DCRaw *d = (DCRaw *)dcraw; va_list ap; va_start(ap, format); ! d->dcraw_message(code, format, ap); va_end(ap); } --- 449,460 ---- void dcraw_message(void *dcraw, int code, char *format, ...) { + char *message; DCRaw *d = (DCRaw *)dcraw; va_list ap; va_start(ap, format); ! message = g_strdup_vprintf(format, ap); ! d->dcraw_message(code, message); va_end(ap); + g_free(message); } Index: ufraw_exiv2.cc =================================================================== RCS file: /cvsroot/ufraw/ufraw/ufraw_exiv2.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ufraw_exiv2.cc 19 Jul 2006 13:32:05 -0000 1.6 --- ufraw_exiv2.cc 4 Aug 2006 22:35:12 -0000 1.7 *************** *** 30,33 **** --- 30,38 ---- uf->exifBufLen = 0; + /* Redirect exiv2 errors to a string buffer */ + std::ostringstream stderror; + std::streambuf *savecerr = std::cerr.rdbuf(); + std::cerr.rdbuf(stderror.rdbuf()); + Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(uf->filename); assert(image.get() != 0); *************** *** 166,169 **** --- 171,177 ---- g_strlcpy(uf->conf->lensText, str.str().c_str(), max_name); } + std::cerr.rdbuf(savecerr); + ufraw_message(UFRAW_SET_LOG, "%s\n", stderror.str().c_str()); + return UFRAW_SUCCESS; } |