Send metadata for textures to get correct upload cost estimate.#5554
Send metadata for textures to get correct upload cost estimate.#5554Rider-Linden wants to merge 2 commits intorelease/2026.02from
Conversation
… upload, include metadata about the texture size.
There was a problem hiding this comment.
Pull request overview
This PR updates the mesh upload fee estimation request so the simulator receives enough texture metadata (dimensions) to correctly estimate upload cost when full texture binaries are not included.
Changes:
- Add
texture_infoentries (width/height) during the fee-estimation path (include_textures == false) instead of sending only empty texture blobs. - Preserve existing behavior for full uploads (
include_textures == true) by still sending the completetexture_list. - Minor indentation/formatting fix in
wholeModelToLLSD().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| else | ||
| { // When not including the whole texture, we need to send some metadata about the image | ||
| // 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. |
indra/newview/llmeshrepository.cpp
Outdated
| info["width"] = texture->getFullWidth(); | ||
| info["height"] = texture->getFullHeight(); |
There was a problem hiding this comment.
It's unlikely texture won't be loaded, but actual values in getFullWidth/getFullHeight might be inaccurate as texture wasn't yet converted to upload format from native format (mesh uploader just takes them as is, see LLImportMaterial), so it's better to convert to LLImageJ2C first.
And if getFullWidth() is 0, there likely is nothing to upload. If it haven't loaded by this point, likely never will, uploader would have waitied for it. Reporting a placeholder size would be counter productive.
…get image hight and width from the jpeg.
marchcat
left a comment
There was a problem hiding this comment.
I'm trying to bring back my earlier attempt on better GLTF material uploading alongside the model.
This fix doesn't seem to interfere with that work.
When sending the request for a cost estimate for texture upload, include metadata about the texture size.
Issue: #5547
Description
During the price check phase of mesh upload, the simulator would send an array of empty textures (0 byte blobs).
In order to apply the correct upload cost, the simulator must be provided with at least the dimensions of the expected textures.
Related Issues
Issue: https://github.com/secondlife/server/issues/2392
Pull: https://github.com/secondlife/server/pull/2402
Checklist
Please ensure the following before requesting review:
Additional Notes