From 246146d26f4f9b9aa2869e6f6cef83e4ebf13c27 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Wed, 18 Nov 2009 21:20:29 -0700 Subject: Cleaned up a harmless bad merge in llimagej2coj.cpp --- ChangeLog.txt | 7 +++++++ linden/indra/llimagej2coj/llimagej2coj.cpp | 33 +++++++++++++++++------------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 8d437c9..5061141 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,10 @@ +2009-11-18 McCabe Maxsted + + * Cleaned up a harmless bad merge in llimagej2coj.cpp. + + modified: linden/indra/llimagej2coj/llimagej2coj.cpp + + 2009-11-12 McCabe Maxsted * Fixed Hide Group Titles preferences option. diff --git a/linden/indra/llimagej2coj/llimagej2coj.cpp b/linden/indra/llimagej2coj/llimagej2coj.cpp index ef498db..dc2d86a 100644 --- a/linden/indra/llimagej2coj/llimagej2coj.cpp +++ b/linden/indra/llimagej2coj/llimagej2coj.cpp @@ -57,26 +57,42 @@ void fallbackDestroyLLImageJ2CImpl(LLImageJ2CImpl* impl) impl = NULL; } +// Return string from message, eliminating final \n if present +static std::string chomp(const char* msg) +{ + // stomp trailing \n + std::string message = msg; + if (!message.empty()) + { + size_t last = message.size() - 1; + if (message[last] == '\n') + { + message.resize( last ); + } + } + return message; +} + /** sample error callback expecting a LLFILE* client object */ void error_callback(const char* msg, void*) { - lldebugs << "LLImageJ2CImpl error_callback: " << msg << llendl; + lldebugs << "LLImageJ2COJ: " << chomp(msg) << llendl; } /** sample warning callback expecting a LLFILE* client object */ void warning_callback(const char* msg, void*) { - lldebugs << "LLImageJ2CImpl warning_callback: " << msg << llendl; + lldebugs << "LLImageJ2COJ: " << chomp(msg) << llendl; } /** sample debug callback expecting no client object */ void info_callback(const char* msg, void*) { - lldebugs << "LLImageJ2CImpl info_callback: " << msg << llendl; + lldebugs << "LLImageJ2COJ: " << chomp(msg) << llendl; } @@ -171,17 +187,6 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod return TRUE; } } - - if(image->numcomps <= first_channel) - { - llwarns << "trying to decode more channels than are present in image: numcomps: " << image->numcomps << " first_channel: " << first_channel << llendl; - if (image) - { - opj_image_destroy(image); - } - - return TRUE; - } if(image->numcomps <= first_channel) { -- cgit v1.1