diff --git a/indra/llimage/llimagedimensionsinfo.cpp b/indra/llimage/llimagedimensionsinfo.cpp index 97b543f3b6fee4fbadcefe3a25edff5c5a944b68..5756ddb32b89f8ec4c0527c5f0d7de94e5e6ce91 100644 --- a/indra/llimage/llimagedimensionsinfo.cpp +++ b/indra/llimage/llimagedimensionsinfo.cpp @@ -90,6 +90,7 @@ bool LLImageDimensionsInfo::getImageDimensionsBmp() if (signature[0] != 'B' || signature[1] != 'M') { LL_WARNS() << "Not a BMP" << LL_ENDL; + mWarning = "IncorrectFormat"; return false; } @@ -140,6 +141,7 @@ bool LLImageDimensionsInfo::getImageDimensionsPng() if (memcmp(signature, png_magic, PNG_MAGIC_SIZE) != 0) { LL_WARNS() << "Not a PNG" << LL_ENDL; + mWarning = "IncorrectFormat"; return false; } @@ -183,6 +185,7 @@ bool LLImageDimensionsInfo::getImageDimensionsJpeg() if (memcmp(signature, jpeg_magic, JPEG_MAGIC_SIZE) != 0) { LL_WARNS() << "Not a JPEG" << LL_ENDL; + mWarning = "IncorrectFormat"; return false; } fseek(fp, 0, SEEK_SET); // go back to start of the file diff --git a/indra/llimage/llimagedimensionsinfo.h b/indra/llimage/llimagedimensionsinfo.h index 8f716c5d027e1fb401bd05a7fb0b0c0268bbbc62..ade283bb8582becc47927229e770a04b50127236 100644 --- a/indra/llimage/llimagedimensionsinfo.h +++ b/indra/llimage/llimagedimensionsinfo.h @@ -55,6 +55,12 @@ class LLImageDimensionsInfo { return mLastError; } + + const std::string& getWarningName() + { + return mWarning; + } + protected: void clean() @@ -129,6 +135,7 @@ class LLImageDimensionsInfo std::string mSrcFilename; std::string mLastError; + std::string mWarning; U8* mData; diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index de8db69e191a6f5ae988e42478a6a02381768079..72ef365a6d8724f89d1d93c397b2f9d08acaa58e 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -982,6 +982,9 @@ bool LLLocalBitmapMgr::checkTextureDimensions(std::string filename) LLImageDimensionsInfo image_info; if (!image_info.load(filename,codec)) { + LLSD args; + args["NAME"] = gDirUtilp->getBaseFileName(filename); + LLNotificationsUtil::add(image_info.getWarningName(), args); return false; } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index a216ef7c0d350e408ad5005772c5409cbf12c7c7..a4b73879b8b633dabca1ce1a1065beca31d30788 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -11986,5 +11986,13 @@ Would you like to save them first? notext="No" yestext="Yes"/> </notification> - + + <notification + icon="notifytip.tga" + name="IncorrectFormat" + priority="high" + type="notifytip"> +Unable to upload '[NAME]' due to the following reason: incorrect image format. + </notification> + </notifications>