"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/gmic_cli.cpp" between
gmic_2.8.1.tar.gz and gmic_2.8.2.tar.gz

About: G’MIC (GREY’s Magic for Image Computing) is a framework for image processing. It provides several different user interfaces to convert/manipulate/filter/ visualize generic image datasets (usable standalone or as plug-in for GIMP and Krita).

gmic_cli.cpp  (gmic_2.8.1):gmic_cli.cpp  (gmic_2.8.2)
skipping to change at line 243 skipping to change at line 243
for (int l = 1; l<argc; ++l) { // Split argv as items for (int l = 1; l<argc; ++l) { // Split argv as items
if (std::strchr(argv[l],' ')) { if (std::strchr(argv[l],' ')) {
CImg<char>::vector('\"').move_to(items); CImg<char>::vector('\"').move_to(items);
CImg<char>(argv[l],(unsigned int)std::strlen(argv[l])).move_to(items); CImg<char>(argv[l],(unsigned int)std::strlen(argv[l])).move_to(items);
CImg<char>::string("\"").move_to(items); CImg<char>::string("\"").move_to(items);
} else CImg<char>::string(argv[l]).move_to(items); } else CImg<char>::string(argv[l]).move_to(items);
items.back().back()=' '; items.back().back()=' ';
} }
// Determine special mode for running .gmic files as scripts : 'gmic command s.gmic [arguments]'. // Determine special mode for running .gmic files as scripts : 'gmic command s.gmic [arguments]'.
if ((argc==2 || argc==3) && !std::strcmp(cimg::split_filename(argv[1]),"gmic if (argc==2 || argc==3) {
")) { const char *const ext = cimg::split_filename(argv[1]);
std::FILE *gmic_file = std::fopen(argv[1],"rb"); if (!*ext || !std::strcmp(ext,"gmic")) {
if (gmic_file) { std::FILE *gmic_file = std::fopen(argv[1],"rb");
gmic().add_commands(gmic_file,argv[1],0,0,&gmic_instance.allow_entrypoin if (gmic_file) {
t); bool allow_entrypoint = false;
std::fclose(gmic_file); gmic gi(0,0,false,0,0,(gmic_pixel_type)0);
gi.add_commands(gmic_file,argv[1],0,0,&allow_entrypoint);
if (allow_entrypoint && argc==3) { // Check if command '_main_' has ar
guments
const unsigned int hash = (int)gmic::hashcode("_main_",false);
unsigned int ind = 0;
if (gmic::search_sorted("_main_",gi.commands_names[hash],
gi.commands_names[hash].size(),ind)) // Comm
and found
allow_entrypoint = (bool)gi.commands_has_arguments[hash](ind,0);
}
gmic_instance.allow_entrypoint = allow_entrypoint;
std::fclose(gmic_file);
}
} }
} }
// Determine initial verbosity. // Determine initial verbosity.
const char *const s_verbosity = std::getenv("GMIC_VERBOSITY"); const char *const s_verbosity = std::getenv("GMIC_VERBOSITY");
if (!s_verbosity || std::sscanf(s_verbosity,"%d%c",&gmic_instance.verbosity, &sep)!=1) if (!s_verbosity || std::sscanf(s_verbosity,"%d%c",&gmic_instance.verbosity, &sep)!=1)
gmic_instance.verbosity = gmic_instance.allow_entrypoint?0:1; gmic_instance.verbosity = gmic_instance.allow_entrypoint?0:1;
} }
// Insert startup command. // Insert startup command.
 End of changes. 1 change blocks. 
7 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)