Skip to content

Commit 71a601c

Browse files
committed
Gdal translate: make sure output directory exists
1 parent 183a6c0 commit 71a601c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

gdalalgo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,8 @@ gdal::RasterDataSet translate(const gdal::RasterDataSet& ds, const fs::path& out
522522
ProgressInfo progress(progressCb);
523523
TranslateOptionsWrapper gdalOptions(options, progress);
524524

525+
file::create_directory_for_file(outputPath);
526+
525527
int userError = 0;
526528
auto resultDs = gdal::RasterDataSet(GDALTranslate(outputPath.empty() ? nullptr : file::generic_u8string(outputPath).c_str(), ds.get(), gdalOptions.get(), &userError));
527529

0 commit comments

Comments
 (0)