summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatersimplesnapshot.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-09-09 00:00:22 +0300
committerakleshchev <117672381+akleshchev@users.noreply.github.com>2023-09-10 21:49:00 +0300
commitcfb69846f1e8309ed86d4a18eb26a889f6dbaccc (patch)
treecb5507d1d5a8600f312d3b25d404fd2c50384050 /indra/newview/llfloatersimplesnapshot.cpp
parent46425b2e49377acc186e41c67a793f7f6b7f583b (diff)
SL-20261 Allow and resize existing textures as necessary for thumbnails
Diffstat (limited to 'indra/newview/llfloatersimplesnapshot.cpp')
-rw-r--r--indra/newview/llfloatersimplesnapshot.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/indra/newview/llfloatersimplesnapshot.cpp b/indra/newview/llfloatersimplesnapshot.cpp
index 757ac605e3..58604c5628 100644
--- a/indra/newview/llfloatersimplesnapshot.cpp
+++ b/indra/newview/llfloatersimplesnapshot.cpp
@@ -398,6 +398,21 @@ void LLFloaterSimpleSnapshot::uploadThumbnail(const std::string &file_path, cons
}
// static
+void LLFloaterSimpleSnapshot::uploadThumbnail(LLPointer<LLImageRaw> raw_image, const LLUUID& inventory_id, const LLUUID& task_id)
+{
+ std::string temp_file = gDirUtilp->getTempFilename();
+ if (!LLViewerTextureList::createUploadFile(raw_image, temp_file, THUMBNAIL_SNAPSHOT_DIM_MAX, THUMBNAIL_SNAPSHOT_DIM_MIN))
+ {
+ LLSD notif_args;
+ notif_args["REASON"] = LLImage::getLastError().c_str();
+ LLNotificationsUtil::add("CannotUploadTexture", notif_args);
+ LL_WARNS("Thumbnail") << "Failed to upload thumbnail for " << inventory_id << " " << task_id << ", reason: " << notif_args["REASON"].asString() << LL_ENDL;
+ return;
+ }
+ uploadImageUploadFile(temp_file, inventory_id, task_id);
+}
+
+// static
void LLFloaterSimpleSnapshot::uploadImageUploadFile(const std::string &temp_file, const LLUUID &inventory_id, const LLUUID &task_id)
{
LLSD data;