Make sure we don't upload empty images
This commit is contained in:
parent
f04aa81b9f
commit
40d9edd7a8
@ -31,7 +31,7 @@ RecordingFormats::RecordingFormats(formats::Recording f) {
|
|||||||
delete enc;
|
delete enc;
|
||||||
if (interrupt) {
|
if (interrupt) {
|
||||||
tmpDir.removeRecursively();
|
tmpDir.removeRecursively();
|
||||||
return;
|
return QByteArray();
|
||||||
}
|
}
|
||||||
QFile res(path);
|
QFile res(path);
|
||||||
if (!res.open(QFile::ReadOnly)) {
|
if (!res.open(QFile::ReadOnly)) {
|
||||||
|
@ -73,6 +73,7 @@ void UploaderSingleton::upload(QPixmap *pixmap) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void UploaderSingleton::upload(QByteArray img, QString format) {
|
void UploaderSingleton::upload(QByteArray img, QString format) {
|
||||||
|
if (img.isEmpty()) return;
|
||||||
QFile file(saveDir.absoluteFilePath(formatter::format(settings::settings().value("fileFormat").toString(), format.toLower())));
|
QFile file(saveDir.absoluteFilePath(formatter::format(settings::settings().value("fileFormat").toString(), format.toLower())));
|
||||||
if (file.open(QFile::WriteOnly)) {
|
if (file.open(QFile::WriteOnly)) {
|
||||||
file.write(img);
|
file.write(img);
|
||||||
|
Loading…
Reference in New Issue
Block a user