Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/templates/paint_on_template_feature.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2012, 2013 Thomas Schöps
* Copyright 2012-2020 Kai Pastor
* Copyright 2012-2020, 2025 Kai Pastor
*
* This file is part of OpenOrienteering.
*
Expand Down Expand Up @@ -37,6 +37,7 @@
#include <QFontMetrics>
#include <QIcon>
#include <QImage>
#include <QImageWriter>
#include <QLatin1Char>
#include <QLatin1String>
#include <QList>
Expand Down Expand Up @@ -332,12 +333,13 @@ Template* PaintOnTemplateFeature::setupTemplate() const
}
else
{
auto image = makeImage(filename);
if (!image.save(image_file_path))
const auto image = makeImage(filename);
QImageWriter writer(image_file_path);
if (!writer.write(image))
{
showMessage(window,
OpenOrienteering::MapEditorController::tr("Cannot save file\n%1:\n%2")
.arg(filename, QString{}));
.arg(filename, writer.errorString()));
return nullptr;
}
remove_file = true;
Expand Down