diff options
Diffstat (limited to 'indra/llimage/llimageworker.cpp')
-rw-r--r-- | indra/llimage/llimageworker.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp index fd59daad3d..06aaeb0e84 100644 --- a/indra/llimage/llimageworker.cpp +++ b/indra/llimage/llimageworker.cpp @@ -58,6 +58,7 @@ private: BOOL mDecodedRaw; BOOL mDecodedAux; LLPointer<LLImageDecodeThread::Responder> mResponder; + std::string mErrorString; }; @@ -154,8 +155,9 @@ ImageRequest::~ImageRequest() bool ImageRequest::processRequest() { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; - const F32 decode_time_slice = 0.f; //disable time slicing - bool done = true; + const F32 decode_time_slice = 0.f; //disable time slicing + bool done = true; + mErrorString.clear(); if (!mDecodedRaw && mFormattedImage.notNull()) { // Decode primary channels @@ -164,10 +166,13 @@ bool ImageRequest::processRequest() // parse formatted header if (!mFormattedImage->updateData()) { + // Pick up errors from updateData + mErrorString = LLImage::getLastThreadError(); return true; // done (failed) } if (!(mFormattedImage->getWidth() * mFormattedImage->getHeight() * mFormattedImage->getComponents())) { + mErrorString = "Invalid image size"; return true; // done (failed) } if (mDiscardLevel >= 0) @@ -181,6 +186,9 @@ bool ImageRequest::processRequest() done = mFormattedImage->decode(mDecodedImageRaw, decode_time_slice); // some decoders are removing data when task is complete and there were errors mDecodedRaw = done && mDecodedImageRaw->getData(); + + // Pick up errors from decoding + mErrorString = LLImage::getLastThreadError(); } if (done && mNeedsAux && !mDecodedAux && mFormattedImage.notNull()) { @@ -193,7 +201,10 @@ bool ImageRequest::processRequest() } done = mFormattedImage->decodeChannels(mDecodedImageAux, decode_time_slice, 4, 4); mDecodedAux = done && mDecodedImageAux->getData(); - } + + // Pick up errors from decoding + mErrorString = LLImage::getLastThreadError(); + } return done; } @@ -204,7 +215,7 @@ void ImageRequest::finishRequest(bool completed) if (mResponder.notNull()) { bool success = completed && mDecodedRaw && (!mNeedsAux || mDecodedAux); - mResponder->completed(success, mDecodedImageRaw, mDecodedImageAux, mRequestId); + mResponder->completed(success, mErrorString, mDecodedImageRaw, mDecodedImageAux, mRequestId); } // Will automatically be deleted } |