Skip to content

Commit f48c022

Browse files
committed
small fixes
Signed-off-by: Anton Dukhovnikov <[email protected]>
1 parent 21d5461 commit f48c022

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

src/rawtoaces2/main.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ int main( int argc, const char *argv[] )
3838

3939
for ( auto filename2: it )
4040
{
41-
if ( std::filesystem::is_regular_file( filename ) ||
42-
std::filesystem::is_symlink( filename ) )
41+
if ( std::filesystem::is_regular_file( filename2 ) ||
42+
std::filesystem::is_symlink( filename2 ) )
4343
{
4444
files_to_convert.push_back( filename2.path().string() );
4545
}
@@ -58,6 +58,7 @@ int main( int argc, const char *argv[] )
5858
}
5959
}
6060

61+
bool result = true;
6162
for ( auto const &input_filename: files_to_convert )
6263
{
6364
std::string output_filename = input_filename;
@@ -72,30 +73,34 @@ int main( int argc, const char *argv[] )
7273
{
7374
std::cerr << "Failed to configure the reader for the file: "
7475
<< input_filename << std::endl;
75-
return 1;
76+
result = false;
77+
continue;
7678
}
7779

7880
if ( !converter.load( input_filename ) )
7981
{
8082
std::cerr << "Failed to read for the file: " << input_filename
8183
<< std::endl;
82-
return 1;
84+
result = false;
85+
continue;
8386
}
8487

8588
if ( !converter.process() )
8689
{
8790
std::cerr << "Failed to convert the file: " << input_filename
8891
<< std::endl;
89-
return 1;
92+
result = false;
93+
continue;
9094
}
9195

9296
if ( !converter.save( output_filename ) )
9397
{
9498
std::cerr << "Failed to save the file: " << output_filename
9599
<< std::endl;
96-
return 1;
100+
result = false;
101+
continue;
97102
}
98103
}
99104

100-
return 0;
105+
return result ? 0 : 1;
101106
}

src/rawtoaces_util2/rawtoaces_util.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ bool check_param(
290290
std::cerr << "Warning: " << mode_name << " was set to \""
291291
<< mode_value << "\", but no \"--" << param_name
292292
<< "\" parameter provided. " << default_value_message
293-
<< " will be used." << std::endl;
293+
<< std::endl;
294294

295295
on_failure();
296296
return false;
@@ -300,8 +300,7 @@ bool check_param(
300300
{
301301
std::cerr << "Warning: The parameter \"" << param_name
302302
<< "\" must have " << correct_size << " values. "
303-
<< default_value_message << " will be used."
304-
<< std::endl;
303+
<< default_value_message << std::endl;
305304

306305
on_failure();
307306
return false;
@@ -497,7 +496,7 @@ bool ImageConverter::parse( int argc, const char *argv[] )
497496
"custom-wb",
498497
custom_wb,
499498
4,
500-
"The scalers will be ignored. The default values of (1, 1, 1)",
499+
"The scalers will be ignored. The default values of (1, 1, 1, 1) will be used",
501500
wbMethod == WBMethod::Custom,
502501
[&]() {
503502
for ( int i = 0; i < 4; i++ )
@@ -515,7 +514,7 @@ bool ImageConverter::parse( int argc, const char *argv[] )
515514
"custom-mat",
516515
custom_mat,
517516
9,
518-
"Identity matrix",
517+
"Identity matrix will be used",
519518
matrixMethod == MatrixMethod::Custom,
520519
[&]() {
521520
for ( int i = 0; i < 3; i++ )
@@ -571,7 +570,11 @@ bool ImageConverter::configure( const std::string &input_filename )
571570
}
572571

573572
auto imageInput = OIIO::ImageInput::create( "raw", false, &_inputHint );
574-
imageInput->open( input_filename, _inputFull, _inputHint );
573+
bool result = imageInput->open( input_filename, _inputFull, _inputHint );
574+
if (!result)
575+
{
576+
return false;
577+
}
575578

576579
_is_DNG = _inputFull.extra_attribs.find( "raw:dng:version" )->get_int() > 0;
577580

0 commit comments

Comments
 (0)