{"record":{"id":"9c81f875504c923b","repo":"Yalantis/uCrop","slug":"s","errorCode":null,"errorMessage":"%s","messagePattern":"%s","errorType":"exception","errorClass":"CImgArgumentException","httpStatus":null,"severity":"error","filePath":"ucrop/src/main/jni/CImg.h","lineNumber":35182,"sourceCode":"              }\n#endif\n            }\n          }\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.","sourceCodeStart":35164,"sourceCodeEnd":35200,"githubUrl":"https://github.com/Yalantis/uCrop/blob/f788b534b48c144edf786c8cddbf0e029e637804/ucrop/src/main/jni/CImg.h#L35164-L35200","documentation":"Inside CImg's fill() expression machinery, when the fill expression fails to parse as a valid value sequence and an earlier parse error message was captured (is_error_expr), the library rethrows that specific parser message verbatim as a CImgArgumentException, prefixed with the instance description (_cimg_instance).","triggerScenarios":"Calling fill(\"expression\") where the expression is malformed such that the expression parser itself records an error string (is_error_expr non-empty) — e.g. invalid operators, bad variable names, or truncated formulas in the mini formula language.","commonSituations":"Typos in fill() math expressions; expressions copied from docs of a different CImg version; user-supplied expression strings passed through without validation; locale/whitespace issues breaking the parser.","solutions":["Check the embedded message (it is substituted for %s) for the exact parser complaint and fix the expression syntax","Validate expressions against CImg's fill() formula grammar before calling","Test the expression on a tiny dummy image in a try/catch during development","Sanitize/reject user-supplied expressions with a pre-parse validator"],"exampleFix":"// before\nimg.fill(\"x*y?%/2\"); // malformed expression\n// after\nimg.fill(\"x*y\"); // valid fill expression","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { img.fill(expr.c_str()); } catch (CImgArgumentException& e) { /* e.what() embeds the parser message; log and reject expression */ }","preventionTips":["Test fill expressions on a dummy image before production use","Restrict user-supplied expressions to a validated subset","Pin CImg version and consult its fill() grammar docs"],"tags":["cimg","fill","expression-parsing","invalid-argument"],"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"}