diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-02-25 23:08:38 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-02-25 23:08:38 +0200 |
commit | dd656390c3b6cbdfc6e88c8ff3e6a011238b6f6e (patch) | |
tree | 96a918a5f4bc07f445d122a63bb8f56314359cef /indra/newview/llfloatersimplesnapshot.cpp | |
parent | 2b56570c6867dc39aa4c8a19d2657ffed6c596b2 (diff) |
SL-19108 Only permit 64 to 256 px images for thumbnails
Diffstat (limited to 'indra/newview/llfloatersimplesnapshot.cpp')
-rw-r--r-- | indra/newview/llfloatersimplesnapshot.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/indra/newview/llfloatersimplesnapshot.cpp b/indra/newview/llfloatersimplesnapshot.cpp index 0bf4bb4fc3..83f4f1ace9 100644 --- a/indra/newview/llfloatersimplesnapshot.cpp +++ b/indra/newview/llfloatersimplesnapshot.cpp @@ -42,7 +42,8 @@ LLSimpleSnapshotFloaterView* gSimpleSnapshotFloaterView = NULL; -const S32 THUMBNAIL_SNAPSHOT_DIM = 256; +const S32 LLFloaterSimpleSnapshot::THUMBNAIL_SNAPSHOT_DIM_MAX = 256; +const S32 LLFloaterSimpleSnapshot::THUMBNAIL_SNAPSHOT_DIM_MIN = 64; // Thumbnail posting coro @@ -176,8 +177,8 @@ void LLFloaterSimpleSnapshot::Impl::updateResolution(void* data) return; } - S32 width = THUMBNAIL_SNAPSHOT_DIM; - S32 height = THUMBNAIL_SNAPSHOT_DIM; + S32 width = THUMBNAIL_SNAPSHOT_DIM_MAX; + S32 height = THUMBNAIL_SNAPSHOT_DIM_MAX; LLSnapshotLivePreview* previewp = getPreviewView(); if (previewp) @@ -342,7 +343,7 @@ void LLFloaterSimpleSnapshot::onSend() LLSnapshotLivePreview* previewp = getPreviewView(); std::string temp_file = gDirUtilp->getTempFilename(); - if (previewp->createUploadFile(temp_file, THUMBNAIL_SNAPSHOT_DIM)) + if (previewp->createUploadFile(temp_file, THUMBNAIL_SNAPSHOT_DIM_MAX, THUMBNAIL_SNAPSHOT_DIM_MIN)) { uploadImageUploadFile(temp_file, mInventoryId, mTaskId); } @@ -365,7 +366,7 @@ void LLFloaterSimpleSnapshot::uploadThumbnail(const std::string &file_path, cons // generate a temp texture file for coroutine std::string temp_file = gDirUtilp->getTempFilename(); U32 codec = LLImageBase::getCodecFromExtension(gDirUtilp->getExtension(file_path)); - if (!LLViewerTextureList::createUploadFile(file_path, temp_file, codec, THUMBNAIL_SNAPSHOT_DIM)) + if (!LLViewerTextureList::createUploadFile(file_path, temp_file, codec, THUMBNAIL_SNAPSHOT_DIM_MAX, THUMBNAIL_SNAPSHOT_DIM_MIN)) { LLSD notif_args; notif_args["REASON"] = LLImage::getLastError().c_str(); |