diff options
author | Erik Kundiman <erik@megapahit.org> | 2025-08-16 06:39:13 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2025-08-16 06:39:13 +0800 |
commit | 2d8948ef173c5bfc37834301f4aa4fb72e78f03c (patch) | |
tree | 68b8ce2297ec590ac3f5af2e4f34736f15d7e193 /indra/newview/llfloaterimagepreview.cpp | |
parent | 977b636f37cd4a53caa1db084c07294f67212c0e (diff) | |
parent | 37a04baf104aa394615d8e8286522988ba56c09d (diff) |
Merge tag 'Second_Life_Release#37a04baf-2025.06' into 2025.06
Diffstat (limited to 'indra/newview/llfloaterimagepreview.cpp')
-rw-r--r-- | indra/newview/llfloaterimagepreview.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 42a5df5d17..550c3adc27 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -288,7 +288,9 @@ void LLFloaterImagePreview::onBtnOK() } else { - LLNotificationsUtil::add("ErrorEncodingImage"); + LLSD args; + args["REASON"] = LLImage::getLastThreadError(); + LLNotificationsUtil::add("ErrorEncodingImage", args); LL_WARNS() << "Error encoding image" << LL_ENDL; } } @@ -423,6 +425,18 @@ bool LLFloaterImagePreview::loadImage(const std::string& src_filename) return false; } + // raw image is limited to 256MB so need at least some upper limit that fits into that + constexpr S32 MAX_IMAGE_AREA = 8096 * 8096; + + if (image_info.getWidth() * image_info.getHeight() > MAX_IMAGE_AREA) + { + LLStringUtil::format_map_t args; + args["PIXELS"] = llformat("%dM", (S32)(MAX_IMAGE_AREA / 1000000)); + + mImageLoadError = LLTrans::getString("texture_load_area_error", args); + return false; + } + // Load the image LLPointer<LLImageFormatted> image = LLImageFormatted::createFromType(codec); if (image.isNull()) |