From 8ef8497add2007d29de1cb75b55e77349a7c717f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 8 Jun 2022 19:36:29 +0300 Subject: SL-17532 Cap image size for profile image preview --- indra/newview/llfloaterprofiletexture.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/indra/newview/llfloaterprofiletexture.cpp b/indra/newview/llfloaterprofiletexture.cpp index 743685e7d1..bf1f56a6d1 100644 --- a/indra/newview/llfloaterprofiletexture.cpp +++ b/indra/newview/llfloaterprofiletexture.cpp @@ -115,6 +115,16 @@ void LLFloaterProfileTexture::updateDimensions() S32 width = old_floater_rect.getWidth() - old_image_rect.getWidth() + mLastWidth; S32 height = old_floater_rect.getHeight() - old_image_rect.getHeight() + mLastHeight; + const F32 MAX_DIMENTIONS = 512; // most profiles are supposed to be 256x256 + + S32 biggest_dim = llmax(width, height); + if (biggest_dim > MAX_DIMENTIONS) + { + F32 scale_down = MAX_DIMENTIONS / (F32)biggest_dim; + width *= scale_down; + height *= scale_down; + } + //reshape floater reshape(width, height); -- cgit v1.2.3