From f324e67780cb002149b11d0fbf49f5d1794b7299 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Mon, 23 Jan 2012 17:49:09 +0200
Subject: [PATCH] EXP-1801 FIXED Fixed the "snapshot to disk" shortcut (Ctrl+`)
 to respect preferred snapshot format.

Restoring mistakenly removed code.
---
 indra/newview/llviewermenufile.cpp | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index 7e830e14bf2..8ee514e7c24 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -527,8 +527,22 @@ class LLFileTakeSnapshotToDisk : public view_listener_t
 									   FALSE))
 		{
 			gViewerWindow->playSnapshotAnimAndSound();
-			
-			LLPointer<LLImageFormatted> formatted = new LLImagePNG;
+			LLPointer<LLImageFormatted> formatted;
+			switch(LLFloaterSnapshot::ESnapshotFormat(gSavedSettings.getS32("SnapshotFormat")))
+			{
+			case LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG:
+				formatted = new LLImageJPEG(gSavedSettings.getS32("SnapshotQuality"));
+				break;
+			case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG:
+				formatted = new LLImagePNG;
+				break;
+			case LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP:
+				formatted = new LLImageBMP;
+				break;
+			default:
+				llwarns << "Unknown Local Snapshot format" << llendl;
+				return true;
+			}
 			formatted->enableOverSize() ;
 			formatted->encode(raw, 0);
 			formatted->disableOverSize() ;
-- 
GitLab