{"record":{"id":"89273129af6c2df4","repo":"Yalantis/uCrop","slug":"cimg-appname-math-parser-cimg-s-s-s-i-892731","errorCode":null,"errorMessage":"[\" cimg_appname \"_math_parser] CImg<%s>::%s: %s: Invalid specified operator (should be one of '=,+,-,*,/,&,|,xor,&&,||,min,max'), in expression '%s'.","messagePattern":"\\[\" cimg_appname \"_math_parser\\] CImg<(.+?)>::(.+?): (.+?): Invalid specified operator \\(should be one of '=,\\+,-,\\*,/,&,\\|,xor,&&,\\|\\|,min,max'\\), in expression '(.+?)'\\.","errorType":"exception","errorClass":"CImgArgumentException","httpStatus":null,"severity":"error","filePath":"ucrop/src/main/jni/CImg.h","lineNumber":22724,"sourceCode":"                    else if (*st_op=='&' && st_op[1]=='&' && !st_op[2]) arg1 = 8;\n                    else if (*st_op=='|' && st_op[1]=='|' && !st_op[2]) arg1 = 9;\n                    else if (*st_op=='m' && st_op[1]=='i' && st_op[2]=='n' && !st_op[3]) arg1 = 10;\n                    else if (*st_op=='m' && st_op[1]=='a' && st_op[2]=='x' && !st_op[3]) arg1 = 11;\n                  }\n                }\n              }\n\n              cimg_rofY(memmerge,k) if (memmerge(0,k)==(int)pos) {\n                _cimg_mp_strerr;\n                throw CImgArgumentException(\"[\" cimg_appname \"_math_parser] \"\n                                            \"CImg<%s>::%s: %s: Merge has already been requested before \"\n                                            \"for specified variable \"\n                                            \"in expression '%s'.\",\n                                            pixel_type(),_cimg_mp_calling_function,s_op,s0);\n              }\n              if (arg1==~0U) {\n                _cimg_mp_strerr;\n                throw CImgArgumentException(\"[\" cimg_appname \"_math_parser] \"\n                                            \"CImg<%s>::%s: %s: Invalid specified operator \"\n                                            \"(should be one of '=,+,-,*,/,&,|,xor,&&,||,min,max'), \"\n                                            \"in expression '%s'.\",\n                                            pixel_type(),_cimg_mp_calling_function,s_op,s0);\n              }\n              memmerge.resize(3,memmerge._height + 1,1,1,0,0);\n              memmerge(0,memmerge._height - 1) = (int)pos;\n              memmerge(1,memmerge._height - 1) = (int)size(pos);\n              memmerge(2,memmerge._height - 1) = (int)arg1;\n              _cimg_mp_return_nan();\n            }\n            break;\n\n          case 'n' :\n#ifdef cimg_mp_func_name\n            if (!std::strncmp(ss,\"name(\",5)) { // Get image name as a string vector\n              _cimg_mp_op(\"Function 'name()'\");\n              if (*ss5=='#') { // Index specified","sourceCodeStart":22706,"sourceCodeEnd":22742,"githubUrl":"https://github.com/Yalantis/uCrop/blob/f788b534b48c144edf786c8cddbf0e029e637804/ucrop/src/main/jni/CImg.h#L22706-L22742","documentation":"Math parser error raised while compiling an assignment/merge operation (e.g. in memmerge handling): the operator string between operands did not match any of the accepted tokens '=,+,-,*,/,&,|,xor,&&,||,min,max', so the variable merge instruction cannot be generated.","triggerScenarios":"Passing an unsupported or misspelled operator string to merge(), e.g. 'merge(V,0,mod)', 'merge(V,0,avg)', or an empty/garbled operator token.","commonSituations":"Assuming merge supports arbitrary operators (mean, pow, %), typos in custom commands, or translating scripts from other mini-languages with richer operator sets.","solutions":["Use one of the supported operators: =,+,-,*,/,&,|,xor,&&,||,min,max","Implement 'avg' manually as sum/count using '+' then divide after merge","Fix typos in the operator argument (e.g. 'min' not 'minimum')"],"exampleFix":"// before\nmerge(V,0,avg)\n// after\nmerge(V,0,+); V/=N","handlingStrategy":"validation","validationCode":"const ops = ['=','+','-','*','/','&','|','xor','&&','||','min','max'];\nops.includes(op) || error('unsupported merge operator: ' + op);","typeGuard":null,"tryCatchPattern":"try { run(expr) } catch (CImgArgumentException &e) { log(e.what()); }","preventionTips":["Only use the 12 documented operators","Implement avg/pow manually around merge","Check spelling of operator tokens"],"tags":["cimg","math-parser","merge","invalid-operator"],"backgroundTag":"invalid-enum-value","analyzedSha":"f788b534b48c144edf786c8cddbf0e029e637804","analyzedAt":"2026-09-08T08:36:04.887Z","contentChangedAt":"2026-09-08T08:36:04.887Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}