Commit 6336a52c authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

Check target file name properly when writing metadata with ExifTool

BUGS: 436876
FIXED-IN: 8.0.0
parent 36f47ac2
Pipeline #161090 failed with stage
in 19 minutes and 43 seconds
......@@ -95,7 +95,20 @@ bool DMetadata::loadUsingExifTool(const QString& filePath)
bool DMetadata::saveUsingExifTool(const QString& filePath) const
{
QFileInfo finfo(filePath);
QString targetPath;
// NOTE: if filePath is empty, we will apply changes on original file, else save changes on different file.
if (!filePath.isEmpty())
{
targetPath = filePath;
}
else
{
targetPath = getFilePath();
}
QFileInfo finfo(targetPath);
QString ext = finfo.suffix().toLower();
if (!writeDngFiles() && (ext == QLatin1String("dng")))
......@@ -121,18 +134,6 @@ bool DMetadata::saveUsingExifTool(const QString& filePath) const
QString exvPath = QFileInfo(getFilePath()).baseName() + QLatin1String("_changes.exv");
QStringList removedTags;
exportChanges(exvPath, removedTags);
QString targetPath;
// NOTE: if filePath is empty, we will apply changex on original file, else save changes on different file.
if (!filePath.isEmpty())
{
targetPath = filePath;
}
else
{
targetPath = getFilePath();
}
if (!parser->applyChanges(targetPath, exvPath))
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment