diff options
| author | Callum Prentice <callum@lindenlab.com> | 2025-08-22 17:12:03 -0700 |
|---|---|---|
| committer | Callum Prentice <callum@lindenlab.com> | 2025-08-22 17:12:03 -0700 |
| commit | e935a8aebca4ae014b5f6b438612ac5674678fe6 (patch) | |
| tree | 531498d040a62c01d444fe91eb99afb091c7fff4 /indra/newview/llfloaterimagepreview.cpp | |
| parent | bebd1b208e1b342fabf59844851124a91513e83b (diff) | |
| parent | cefee59b0e5fff683a50fe61633a9c14493d7145 (diff) | |
Merge branch 'develop' into callum/viewer-cef-2025-08
Diffstat (limited to 'indra/newview/llfloaterimagepreview.cpp')
| -rw-r--r-- | indra/newview/llfloaterimagepreview.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 49e557a6cb..44e71e33f3 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -78,8 +78,8 @@ const S32 PREVIEW_TEXTURE_HEIGHT = 320; //----------------------------------------------------------------------------- // LLFloaterImagePreview() //----------------------------------------------------------------------------- -LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename) : - LLFloaterNameDesc(filename), +LLFloaterImagePreview::LLFloaterImagePreview(const LLSD& args) : + LLFloaterNameDesc(args), mAvatarPreview(NULL), mSculptedPreview(NULL), @@ -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_dimensions_error", args); + return false; + } + // Load the image LLPointer<LLImageFormatted> image = LLImageFormatted::createFromType(codec); if (image.isNull()) |
