Skip to content

Commit

Permalink
Show default DPI value used in --help output
Browse files Browse the repository at this point in the history
  • Loading branch information
vslavik committed Feb 13, 2021
1 parent 8c7215a commit 41ecad1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions diff-pdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ bool g_skip_identical = false;
bool g_mark_differences = false;
long g_channel_tolerance = 0;
// Resolution to use for rasterization, in DPI
long g_resolution = 300;
#define DEFAULT_RESOLUTION 300
long g_resolution = DEFAULT_RESOLUTION;

cairo_surface_t *render_page(PopplerPage *page)
{
Expand Down Expand Up @@ -881,7 +882,7 @@ int main(int argc, char *argv[])
wxCMD_LINE_VAL_NUMBER },

{ wxCMD_LINE_OPTION,
NULL, "dpi", "rasterization dpi",
NULL, "dpi", "rasterization resolution (default: " wxSTRINGIZE(DEFAULT_RESOLUTION) " dpi)",
wxCMD_LINE_VAL_NUMBER },

{ wxCMD_LINE_SWITCH,
Expand Down Expand Up @@ -957,7 +958,7 @@ int main(int argc, char *argv[])
if ( parser.Found("dpi", &g_resolution) )
{
if (g_resolution < 1 || g_resolution > 2400) {
fprintf(stderr, "Invalid dpi: %ld. Valid range is 1-2400\n", g_resolution);
fprintf(stderr, "Invalid dpi: %ld. Valid range is 1-2400 (default: %d)\n", g_resolution, DEFAULT_RESOLUTION);
return 2;
}
}
Expand Down

0 comments on commit 41ecad1

Please sign in to comment.