From 8d5dab9f67d54ce20768c0ccda58f27693cb20c9 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 28 Mar 2025 21:49:58 +0200 Subject: #3809 Fix J2C Upload --- indra/newview/llviewertexturelist.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview/llviewertexturelist.cpp') diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index ae723b4068..9f23d39506 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1419,6 +1419,15 @@ bool LLViewerTextureList::createUploadFile(const std::string& filename, image->setLastError("Couldn't load the image to be uploaded."); return false; } + + // calcDataSizeJ2C assumes maximum size is 2048 and for bigger images can + // assign discard to bring imige to needed size, but upload does the scaling + // as needed, so just reset discard. + // Assume file is full and has 'discard' 0 data. + // Todo: probably a better idea to have some setMaxDimentions in J2C + // called when loading from a local file + image->setDiscardLevel(0); + // Decompress or expand it in a raw image structure LLPointer raw_image = new LLImageRaw; if (!image->decode(raw_image, 0.0f)) -- cgit v1.2.3