Skip to content

Commit

Permalink
gdalwarp: progress bar tunings
Browse files Browse the repository at this point in the history
- make sure that progress for each source file goes to 100%
- display first progress bar after message about copying nodata values
  • Loading branch information
rouault committed Nov 22, 2023
1 parent 4185ffd commit d813ba0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions apps/gdalwarp_bin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ static int CPL_STDCALL WarpTermProgress(double dfProgress,
}
else if (pszMessage != osLastMsg)
{
if (!osLastMsg.empty())
GDALTermProgress(1.0, nullptr, nullptr);
printf("%s : ", pszMessage);
osLastMsg = pszMessage;
iSrc++;
Expand Down
3 changes: 2 additions & 1 deletion apps/gdalwarp_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2582,7 +2582,6 @@ static GDALDatasetH GDALWarpDirect(const char *pszDest, GDALDatasetH hDstDS,
*/
hSrcDS = pahSrcDS[iSrc];
oProgress.iSrc = iSrc;
oProgress.Do(0);

/* --------------------------------------------------------------------
*/
Expand Down Expand Up @@ -3028,6 +3027,8 @@ static GDALDatasetH GDALWarpDirect(const char *pszDest, GDALDatasetH hDstDS,
SetupNoData(pszDest, iSrc, hSrcDS, hWrkSrcDS, hDstDS, psWO, psOptions,
bEnableDstAlpha, bInitDestSetByUser);

oProgress.Do(0);

/* --------------------------------------------------------------------
*/
/* For the first source image of a newly created dataset, decide */
Expand Down

0 comments on commit d813ba0

Please sign in to comment.