summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2026-03-18 16:54:01 -0700
committerRider Linden <rider@lindenlab.com>2026-03-18 16:54:01 -0700
commit6e4e67d4cc2e8e22650e0adfc92caecf09140e0d (patch)
treeb17a56ee2a9034cb0674800bca14159e67d309bc
parent248bab36f76161831c1d84550d85782bc14dfeff (diff)
Always include the empty texture_list array for backwards compat and get image hight and width from the jpeg.
-rw-r--r--indra/newview/llmeshrepository.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 8a3eabf46e..fb6ecedcbf 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -2857,9 +2857,33 @@ void LLMeshUploadThread::packModelIntance(
// to ensure accurate price estimation. If not included, the server will assume all
// textures are 1024 x 1024, which could lead to a low estimate.
LLSD info = LLSD::emptyMap();
- info["width"] = texture->getFullWidth();
- info["height"] = texture->getFullHeight();
+
+ S32 texture_width = 0;
+ S32 texture_height = 0;
+ if (texture->hasSavedRawImage())
+ {
+ LLImageDataLock lock(texture->getSavedRawImage());
+
+ LLPointer<LLImageJ2C> upload_file = LLViewerTextureList::convertToUploadFile(texture->getSavedRawImage());
+
+ if (!upload_file.isNull() && upload_file->getDataSize() && !upload_file->isBufferInvalid())
+ {
+ texture_width = upload_file->getWidth();
+ texture_height = upload_file->getHeight();
+ }
+ }
+
+ if ((texture_width <= 0) || (texture_height <= 0))
+ {
+ // Fall back to the texture's stored dimensions if we can't get dimensions from the raw image.
+ texture_width = texture->getFullWidth();
+ texture_height = texture->getFullHeight();
+ }
+
+ info["width"] = texture_width;
+ info["height"] = texture_height;
res["texture_info"][texture_num] = info;
+ res["texture_list"][texture_num] = LLSD::Binary(); // empty binary to indicate texture is not included, for older server compatibility
}
// store indexes for error handling;
texture_list_dest.push_back(material.mDiffuseMapFilename);