Skip to content

Commit

Permalink
Update WriteTransform preserveFilename logic to preserve the director…
Browse files Browse the repository at this point in the history
…y structure as well. (#606)
  • Loading branch information
JStehouwer authored Mar 29, 2024
1 parent 677e20d commit 22fcbdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openbr/plugins/io/write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class WriteTransform : public TimeVaryingTransform
numImages[dir] = ++value;
OpenCVUtils::saveImage(dst.m(), path);
} else {
QString path = preserveFilename ? QString("%1/%2.%3").arg(outputDirectory, src.file.baseName().split('.')[0], imgExtension)
QString path = preserveFilename ? QString("%1/%2/%3.%4").arg(outputDirectory, src.file.path(), src.file.baseName().split('.')[0], imgExtension)
: QString("%1/image%2%3.%4").arg(outputDirectory).arg(cnt++, padding, 10, QChar('0')).arg(underscore.isEmpty() ? "" : "_" + underscore).arg(imgExtension);
if ((QDir::currentPath() + "/" + path) == src.file.name)
qFatal("Attempted to overwrite image!");
Expand Down

0 comments on commit 22fcbdc

Please sign in to comment.