From 87f496cf7c1c71510e4cb995661f8da5691746da Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 12 Sep 2023 15:01:56 +0300 Subject: SL-20173 show notification when file is empty --- indra/llimage/llimagedimensionsinfo.cpp | 7 ++++--- indra/newview/lllocalbitmaps.cpp | 7 ++++++- indra/newview/skins/default/xui/en/notifications.xml | 10 +--------- indra/newview/skins/default/xui/en/strings.xml | 2 ++ 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/llimage/llimagedimensionsinfo.cpp b/indra/llimage/llimagedimensionsinfo.cpp index 5756ddb32b..9dd69ff132 100644 --- a/indra/llimage/llimagedimensionsinfo.cpp +++ b/indra/llimage/llimagedimensionsinfo.cpp @@ -50,6 +50,7 @@ bool LLImageDimensionsInfo::load(const std::string& src_filename,U32 codec) if (file_size == 0) { + mWarning = "texture_load_empty_file"; setLastError("File is empty",src_filename); return false; } @@ -90,7 +91,7 @@ bool LLImageDimensionsInfo::getImageDimensionsBmp() if (signature[0] != 'B' || signature[1] != 'M') { LL_WARNS() << "Not a BMP" << LL_ENDL; - mWarning = "IncorrectFormat"; + mWarning = "texture_load_format_error"; return false; } @@ -141,7 +142,7 @@ bool LLImageDimensionsInfo::getImageDimensionsPng() if (memcmp(signature, png_magic, PNG_MAGIC_SIZE) != 0) { LL_WARNS() << "Not a PNG" << LL_ENDL; - mWarning = "IncorrectFormat"; + mWarning = "texture_load_format_error"; return false; } @@ -185,7 +186,7 @@ bool LLImageDimensionsInfo::getImageDimensionsJpeg() if (memcmp(signature, jpeg_magic, JPEG_MAGIC_SIZE) != 0) { LL_WARNS() << "Not a JPEG" << LL_ENDL; - mWarning = "IncorrectFormat"; + mWarning = "texture_load_format_error"; return false; } fseek(fp, 0, SEEK_SET); // go back to start of the file diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 72ef365a6d..f435506cff 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -984,7 +984,11 @@ bool LLLocalBitmapMgr::checkTextureDimensions(std::string filename) { LLSD args; args["NAME"] = gDirUtilp->getBaseFileName(filename); - LLNotificationsUtil::add(image_info.getWarningName(), args); + if (!image_info.getWarningName().empty()) + { + args["REASON"] = LLTrans::getString(image_info.getWarningName()); + } + LLNotificationsUtil::add("CannotUploadTexture", args); return false; } @@ -1000,6 +1004,7 @@ bool LLLocalBitmapMgr::checkTextureDimensions(std::string filename) LLSD notif_args; notif_args["REASON"] = mImageLoadError; + notif_args["NAME"] = gDirUtilp->getBaseFileName(filename); LLNotificationsUtil::add("CannotUploadTexture", notif_args); return false; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index a4b73879b8..8f79794006 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -9102,7 +9102,7 @@ You locally updated a [RESOLUTION] baked texture for '[BODYREGION]' after [TIME] icon="alertmodal.tga" name="CannotUploadTexture" type="alertmodal"> -Unable to upload texture. +Unable to upload texture: '[NAME]' [REASON] fail @@ -11987,12 +11987,4 @@ Would you like to save them first? yestext="Yes"/> - -Unable to upload '[NAME]' due to the following reason: incorrect image format. - - diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 0b19ad1473..a23af740fe 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3932,6 +3932,8 @@ Abuse Report none/none Can't load images larger than [WIDTH]*[HEIGHT] + Incorrect image format. + File is empty. Max outfit photo size is [WIDTH]*[HEIGHT]. Please resize or use another image Max outfit photo size is [WIDTH]*[HEIGHT]. Please select another texture Cannot verify photo dimensions. Please wait until photo size is displayed in picker -- cgit v1.2.3