{"record":{"id":"67899f3c1d507d87","repo":"Yalantis/uCrop","slug":"s-invalid-sequence-of-filling-values-s","errorCode":null,"errorMessage":"%s(): Invalid sequence of filling values '%s'.","messagePattern":"(.+?)\\(\\): Invalid sequence of filling values '(.+?)'\\.","errorType":"exception","errorClass":"CImgArgumentException","httpStatus":null,"severity":"error","filePath":"ucrop/src/main/jni/CImg.h","lineNumber":35185,"sourceCode":"          }\n          mp.end();\n\n          if (result_end && mp.result_end) // Transfer result of the end() block if requested\n            result_end->assign(mp.result_end + (mp.result_end_dim?1:0),std::max(1U,mp.result_end_dim));\n\n          is_done = true;\n        } catch (CImgException& e) { CImg<charT>::string(e._message).move_to(is_error_expr); }\n      }\n\n      // Try to fill values according to a value sequence.\n      if (!is_done && mode&1) is_done = !_fill_from_values(expression,repeat_values);\n\n      if (!is_done) {\n        cimg::exception_mode(excmode);\n        if (is_error_expr) throw CImgArgumentException(_cimg_instance\n                                                       \"%s\",\n                                                       cimg_instance,is_error_expr._data);\n        else throw CImgArgumentException(_cimg_instance\n                                         \"%s(): Invalid sequence of filling values '%s'.\",\n                                         cimg_instance,calling_function,expression);\n      }\n      cimg::exception_mode(excmode);\n      cimg_abort_test;\n      return *this;\n    }\n\n    //! Fill sequentially pixel values according to a given expression \\newinstance.\n    CImg<T> get_fill(const char *const expression, const bool repeat_values, const bool allow_formula=true,\n                     CImgList<T> *const list_images=0) const {\n      return (+*this)._fill(expression,repeat_values,allow_formula?3:1,list_images,\"fill\",this,0);\n    }\n\n    //! Fill sequentially pixel values according to a value sequence, given as a string.\n    /**\n       \\param values C-string describing a sequence of values.\n       \\param repeat_values Tells if this sequence must be repeated when filling.","sourceCodeStart":35167,"sourceCodeEnd":35203,"githubUrl":"https://github.com/Yalantis/uCrop/blob/f788b534b48c144edf786c8cddbf0e029e637804/ucrop/src/main/jni/CImg.h#L35167-L35203","documentation":"When fill() cannot interpret the provided expression as a valid sequence of filling values (neither as an expression nor as a value list, and no specific parser error was captured), it throws CImgArgumentException naming the calling function and the offending expression string.","triggerScenarios":"Calling fill(\"...\") with a string that is neither a valid math expression nor a comma-separated sequence of values — e.g. fill(\"1,abc,3\") or an empty/garbage string, with mode&1 path (_fill_from_values) having failed.","commonSituations":"Passing non-numeric text or wrong decimal separators (locale commas) in value lists; empty strings from failed config reads; values lists with wrong separators (spaces vs commas); typos mixing expression and value-list syntax.","solutions":["Fix the value sequence: use a comma-separated list of numeric values, e.g. fill(\"1,2,3\")","If you meant a math expression, ensure it is valid CImg expression syntax (variables x,y,z,c and operators)","Validate the string (numeric-only / parseable) before calling fill(); reject empties","Read the message: it prints calling_function and the literal expression to spot the bad token"],"exampleFix":"// before\nimg.fill(\"1; 2; abc\"); // invalid sequence\n// after\nimg.fill(\"1,2,3\"); // valid comma-separated values","handlingStrategy":"validation","validationCode":"bool isNumericValueList(const std::string& s) { for (char c : s) if (!(isdigit((unsigned char)c) || c==',' || c=='.' || c=='-' || c=='+' || isspace((unsigned char)c))) return false; return !s.empty(); }","typeGuard":null,"tryCatchPattern":"try { img.fill(expr.c_str()); } catch (CImgArgumentException& e) { /* fall back to default fill values or report */ }","preventionTips":["Use comma-separated numeric values for value lists","Avoid locale-dependent decimal separators (always '.')","Validate fill strings before passing them to fill()"],"tags":["cimg","fill","invalid-argument","value-sequence"],"backgroundTag":"invalid-argument-format","analyzedSha":"f788b534b48c144edf786c8cddbf0e029e637804","analyzedAt":"2026-09-08T08:36:04.887Z","contentChangedAt":"2026-09-08T08:36:04.887Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}