diff options
author | McCabe Maxsted | 2009-11-18 21:20:29 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-11-18 21:20:29 -0700 |
commit | 246146d26f4f9b9aa2869e6f6cef83e4ebf13c27 (patch) | |
tree | f40f94c1512863f41b426d48bda539a39c160f80 | |
parent | Fixed Hide Group Titles preferences option (diff) | |
download | meta-impy-246146d26f4f9b9aa2869e6f6cef83e4ebf13c27.zip meta-impy-246146d26f4f9b9aa2869e6f6cef83e4ebf13c27.tar.gz meta-impy-246146d26f4f9b9aa2869e6f6cef83e4ebf13c27.tar.bz2 meta-impy-246146d26f4f9b9aa2869e6f6cef83e4ebf13c27.tar.xz |
Cleaned up a harmless bad merge in llimagej2coj.cpp
-rw-r--r-- | ChangeLog.txt | 7 | ||||
-rw-r--r-- | 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 @@ | |||
1 | 2009-11-18 McCabe Maxsted <hakushakukun@gmail.com> | ||
2 | |||
3 | * Cleaned up a harmless bad merge in llimagej2coj.cpp. | ||
4 | |||
5 | modified: linden/indra/llimagej2coj/llimagej2coj.cpp | ||
6 | |||
7 | |||
1 | 2009-11-12 McCabe Maxsted <hakushakukun@gmail.com> | 8 | 2009-11-12 McCabe Maxsted <hakushakukun@gmail.com> |
2 | 9 | ||
3 | * Fixed Hide Group Titles preferences option. | 10 | * 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) | |||
57 | impl = NULL; | 57 | impl = NULL; |
58 | } | 58 | } |
59 | 59 | ||
60 | // Return string from message, eliminating final \n if present | ||
61 | static std::string chomp(const char* msg) | ||
62 | { | ||
63 | // stomp trailing \n | ||
64 | std::string message = msg; | ||
65 | if (!message.empty()) | ||
66 | { | ||
67 | size_t last = message.size() - 1; | ||
68 | if (message[last] == '\n') | ||
69 | { | ||
70 | message.resize( last ); | ||
71 | } | ||
72 | } | ||
73 | return message; | ||
74 | } | ||
75 | |||
60 | /** | 76 | /** |
61 | sample error callback expecting a LLFILE* client object | 77 | sample error callback expecting a LLFILE* client object |
62 | */ | 78 | */ |
63 | void error_callback(const char* msg, void*) | 79 | void error_callback(const char* msg, void*) |
64 | { | 80 | { |
65 | lldebugs << "LLImageJ2CImpl error_callback: " << msg << llendl; | 81 | lldebugs << "LLImageJ2COJ: " << chomp(msg) << llendl; |
66 | } | 82 | } |
67 | /** | 83 | /** |
68 | sample warning callback expecting a LLFILE* client object | 84 | sample warning callback expecting a LLFILE* client object |
69 | */ | 85 | */ |
70 | void warning_callback(const char* msg, void*) | 86 | void warning_callback(const char* msg, void*) |
71 | { | 87 | { |
72 | lldebugs << "LLImageJ2CImpl warning_callback: " << msg << llendl; | 88 | lldebugs << "LLImageJ2COJ: " << chomp(msg) << llendl; |
73 | } | 89 | } |
74 | /** | 90 | /** |
75 | sample debug callback expecting no client object | 91 | sample debug callback expecting no client object |
76 | */ | 92 | */ |
77 | void info_callback(const char* msg, void*) | 93 | void info_callback(const char* msg, void*) |
78 | { | 94 | { |
79 | lldebugs << "LLImageJ2CImpl info_callback: " << msg << llendl; | 95 | lldebugs << "LLImageJ2COJ: " << chomp(msg) << llendl; |
80 | } | 96 | } |
81 | 97 | ||
82 | 98 | ||
@@ -171,17 +187,6 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod | |||
171 | return TRUE; | 187 | return TRUE; |
172 | } | 188 | } |
173 | } | 189 | } |
174 | |||
175 | if(image->numcomps <= first_channel) | ||
176 | { | ||
177 | llwarns << "trying to decode more channels than are present in image: numcomps: " << image->numcomps << " first_channel: " << first_channel << llendl; | ||
178 | if (image) | ||
179 | { | ||
180 | opj_image_destroy(image); | ||
181 | } | ||
182 | |||
183 | return TRUE; | ||
184 | } | ||
185 | 190 | ||
186 | if(image->numcomps <= first_channel) | 191 | if(image->numcomps <= first_channel) |
187 | { | 192 | { |