mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 05:52:38 +02:00
Merge pull request #112 from overte-org/fix/png_screenshots
Changed screenshot format to PNG
This commit is contained in:
commit
22fd4a80c0
2 changed files with 12 additions and 4 deletions
|
@ -306,7 +306,7 @@ static const uint32_t MAX_CONCURRENT_RESOURCE_DOWNLOADS = 4;
|
|||
// we will never drop below the 'min' value
|
||||
static const int MIN_PROCESSING_THREAD_POOL_SIZE = 2;
|
||||
|
||||
static const QString SNAPSHOT_EXTENSION = ".jpg";
|
||||
static const QString SNAPSHOT_EXTENSION = ".png";
|
||||
static const QString JPG_EXTENSION = ".jpg";
|
||||
static const QString PNG_EXTENSION = ".png";
|
||||
static const QString SVO_EXTENSION = ".svo";
|
||||
|
|
|
@ -42,9 +42,9 @@
|
|||
#include "Snapshot.h"
|
||||
#include "SnapshotUploader.h"
|
||||
|
||||
// filename format: overte-snap-by-%username%-on-%date%_%time%_@-%location%.jpg
|
||||
// filename format: overte-snap-by-%username%-on-%date%_%time%_@-%location%.png
|
||||
// %1 <= username, %2 <= date and time, %3 <= current location
|
||||
const QString FILENAME_PATH_FORMAT = "overte-snap-by-%1-on-%2.jpg";
|
||||
const QString FILENAME_PATH_FORMAT = "overte-snap-by-%1-on-%2.png";
|
||||
const QString DATETIME_FORMAT = "yyyy-MM-dd_hh-mm-ss";
|
||||
const QString SNAPSHOTS_DIRECTORY = "Snapshots";
|
||||
const QString URL = "overte_url";
|
||||
|
@ -385,11 +385,19 @@ QFile* Snapshot::savedFileForSnapshot(QImage& shot,
|
|||
imageQuality = 50;
|
||||
}
|
||||
} else {
|
||||
filename = userSelectedFilename + ".jpg";
|
||||
filename = userSelectedFilename + ".png";
|
||||
imageQuality = 50;
|
||||
}
|
||||
} else {
|
||||
filename = FILENAME_PATH_FORMAT.arg(username, now.toString(DATETIME_FORMAT));
|
||||
QFileInfo snapshotFileInfo(filename);
|
||||
QString filenameSuffix = snapshotFileInfo.suffix();
|
||||
filenameSuffix = filenameSuffix.toLower();
|
||||
if (filenameSuffix == "png") {
|
||||
imageQuality = 50;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!isTemporary) {
|
||||
// If user has requested specific path then use it, else use the application value
|
||||
|
|
Loading…
Reference in a new issue