From e29334a4dcf175b7816bd31923aa45272f66b519 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Fri, 22 Sep 2017 18:00:15 +0200 Subject: [PATCH] rawtherapee-cli: use jpeg compression 92 instead of 0 when called with -j --- rtgui/main-cli.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/rtgui/main-cli.cc b/rtgui/main-cli.cc index 54f536f3a..74f2e1b65 100644 --- a/rtgui/main-cli.cc +++ b/rtgui/main-cli.cc @@ -424,12 +424,16 @@ int processLineParams ( int argc, char **argv ) } } else { outputType = "jpg"; - compression = atoi (currParam.substr (2).c_str()); + if(currParam.size() < 3) { + compression = 92; + } else { + compression = atoi (currParam.substr (2).c_str()); - if (compression < 0 || compression > 100) { - std::cerr << "Error: the value accompanying the -j switch has to be in the [0-100] range!" << std::endl; - deleteProcParams (processingParams); - return -3; + if (compression < 0 || compression > 100) { + std::cerr << "Error: the value accompanying the -j switch has to be in the [0-100] range!" << std::endl; + deleteProcParams (processingParams); + return -3; + } } }