diff options
author | Dave Parks <davep@lindenlab.com> | 2024-05-30 16:28:56 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-30 16:28:56 -0500 |
commit | d1a8a9d0c39bff726e8c298c5bad309055726a30 (patch) | |
tree | ed22bacafc1c42d458cf2c166b6ebb7364a946b5 /indra/newview/llviewertexturelist.cpp | |
parent | 0a4d37f22f78ff0b6095237c7c90bfb627464a94 (diff) |
#1596 Fix for GLTF uploads failing after loading from .glb file (#1602)
Diffstat (limited to 'indra/newview/llviewertexturelist.cpp')
-rw-r--r-- | indra/newview/llviewertexturelist.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 37ff5038cd..930bf4230e 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -518,15 +518,28 @@ LLViewerFetchedTexture* LLViewerTextureList::getImageFromUrl(const std::string& return imagep; } -LLViewerFetchedTexture* LLViewerTextureList::getImageFromMemory(const U8* data, U32 size, std::string_view mimetype) +LLImageRaw* LLViewerTextureList::getRawImageFromMemory(const U8* data, U32 size, std::string_view mimetype) { LLPointer<LLImageFormatted> image = LLImageFormatted::loadFromMemory(data, size, mimetype); if (image) { - LLPointer<LLImageRaw> raw_image = new LLImageRaw(); + LLImageRaw* raw_image = new LLImageRaw(); image->decode(raw_image, 0.f); - LLPointer<LLViewerFetchedTexture> imagep = new LLViewerFetchedTexture(raw_image, FTT_LOCAL_FILE, true); + return raw_image; + } + else + { + return nullptr; + } +} + +LLViewerFetchedTexture* LLViewerTextureList::getImageFromMemory(const U8* data, U32 size, std::string_view mimetype) +{ + LLPointer<LLImageRaw> raw_image = getRawImageFromMemory(data, size, mimetype); + if (raw_image.notNull()) + { + LLViewerFetchedTexture* imagep = new LLViewerFetchedTexture(raw_image, FTT_LOCAL_FILE, true); addImage(imagep, TEX_LIST_STANDARD); imagep->dontDiscard(); |