Merov Linden avatar Merov Linden committed effd55e

STORM-987 : Allow more flexibility around input and output lists

Comments (0)

Files changed (1)

indra/integration_tests/llimage_libtest/llimage_libtest.cpp

 					break;
 				file_name = argv[arg+1];	// Next argument and loop over
 			}
-			// DEBUG output
-			std::list<std::string>::iterator in_file  = input_filenames.begin();
-			std::list<std::string>::iterator end = input_filenames.end();
-			for (; in_file != end; ++in_file)
-			{
-				std::cout << "input file : " << *in_file << std::endl;
-			}
 		}
 		else if (!strcmp(argv[arg], "--out") && arg < argc-1)
 		{
 					break;
 				file_name = argv[arg+1];	// Next argument and loop over
 			}
-			// DEBUG output
-			std::list<std::string>::iterator out_file  = output_filenames.begin();
-			std::list<std::string>::iterator end = output_filenames.end();
-			for (; out_file != end; ++out_file)
-			{
-				std::cout << "output file : " << *out_file << std::endl;
-			}
 		}		
 	}
 		
 		return 0;
 	}
 
+	// Perform action on each input file
 	std::list<std::string>::iterator in_file  = input_filenames.begin();
 	std::list<std::string>::iterator out_file = output_filenames.begin();
-	std::list<std::string>::iterator end = input_filenames.end();
-	for (; in_file != end; ++in_file, ++out_file)
+	std::list<std::string>::iterator in_end = input_filenames.end();
+	std::list<std::string>::iterator out_end = output_filenames.end();
+	for (; in_file != in_end; ++in_file)
 	{
 		// Load file
 		LLPointer<LLImageRaw> raw_image = load_image(*in_file);
 		}
 	
 		// Save file
-		if (!save_image(*out_file, raw_image))
+		if (out_file != out_end)
 		{
-			std::cout << "Error: Image " << *out_file << " could not be saved" << std::endl;
-			continue;
+			if (!save_image(*out_file, raw_image))
+			{
+				std::cout << "Error: Image " << *out_file << " could not be saved" << std::endl;
+			}
+			else
+			{
+				std::cout << *in_file << " -> " << *out_file << std::endl;
+			}
+			++out_file;
 		}
-		std::cout << *in_file << " -> " << *out_file << std::endl;
 
 		// Output stats on each file
 	}
 	
+	// Output perf data if required by user
+	
 	// Cleanup and exit
 	LLImage::cleanupClass();
 	
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.