{"record":{"id":"f25f584d68b101b3","repo":"Yalantis/uCrop","slug":"cimg-appname-math-parser-cimg-s-s-s-t-f25f58","errorCode":null,"errorMessage":"[\" cimg_appname \"_math_parser] CImg<%s>::%s: %s: Type of third argument ('%s') do not match with fourth argument 'nb_colsD=%u', in expression '%s'.","messagePattern":"\\[\" cimg_appname \"_math_parser\\] CImg<(.+?)>::(.+?): (.+?): Type of third argument \\('(.+?)'\\) do not match with fourth argument 'nb_colsD=%u', in expression '(.+?)'\\.","errorType":"exception","errorClass":"CImgArgumentException","httpStatus":null,"severity":"error","filePath":"ucrop/src/main/jni/CImg.h","lineNumber":22647,"sourceCode":"              p2 = size(arg3);\n              const unsigned int\n                wS = (unsigned int)mem[arg2],\n                wD = (unsigned int)mem[arg4],\n                hS = p1/wS,\n                hD = p2/wD;\n\n              if (wS*hS!=p1) {\n                _cimg_mp_strerr;\n                throw CImgArgumentException(\"[\" cimg_appname \"_math_parser] \"\n                                            \"CImg<%s>::%s: %s: Type of first argument ('%s') \"\n                                            \"do not match with second argument 'nb_colsS=%u', \"\n                                            \"in expression '%s'.\",\n                                            pixel_type(),_cimg_mp_calling_function,s_op,\n                                            s_type(arg1)._data,wS,s0);\n              }\n              if (wD*hD!=p2) {\n                _cimg_mp_strerr;\n                throw CImgArgumentException(\"[\" cimg_appname \"_math_parser] \"\n                                            \"CImg<%s>::%s: %s: Type of third argument ('%s') \"\n                                            \"do not match with fourth argument 'nb_colsD=%u', \"\n                                            \"in expression '%s'.\",\n                                            pixel_type(),_cimg_mp_calling_function,s_op,\n                                            s_type(arg3)._data,wD,s0);\n              }\n              if (hS!=hD) {\n                _cimg_mp_strerr;\n                throw CImgArgumentException(\"[\" cimg_appname \"_math_parser] \"\n                                            \"CImg<%s>::%s: %s: Type of first argument ('%s') \"\n                                            \"do not match with third argument ('%s'), \"\n                                            \"in expression '%s'.\",\n                                            pixel_type(),_cimg_mp_calling_function,s_op,\n                                            s_type(arg1)._data,s_type(arg3)._data,s0);\n              }\n              pos = vector(wS*wD);\n              CImg<ulongT>::vector((ulongT)mp_mproj,pos,arg1,wS,hS,arg3,wD,arg5,arg6,p3).move_to(code);\n              return_comp = true;","sourceCodeStart":22629,"sourceCodeEnd":22665,"githubUrl":"https://github.com/Yalantis/uCrop/blob/f788b534b48c144edf786c8cddbf0e029e637804/ucrop/src/main/jni/CImg.h#L22629-L22665","documentation":"Companion check to the source one: the third argument (destination) must have size nb_colsD * nb_rowsD. When wD*hD != p2, the destination column count does not divide the destination vector size and the parser throws.","triggerScenarios":"Same two-matrix op as error 122, but the mismatch is in the destination operand: nb_colsD does not divide size(arg3).","commonSituations":"Destination buffer allocated with a different width than declared, wrong nb_colsD constant, or reusing a destination vector from another computation.","solutions":["Verify size(destination) % nb_colsD == 0; fix nb_colsD or resize destination","Print size of the destination vector before the op","Allocate the destination with the exact rows*cols expected by the op","Ensure the destination is not shared with an unrelated result"],"exampleFix":"// before: destination has 20 values, nb_colsD=3\ndst = vector(20); op(S,dst,3)\n// after\ndst = vector(20); op(S,dst,4) // 20 = 5*4","handlingStrategy":"validation","validationCode":"size(dst) % nb_colsD == 0 || error \"destination size not divisible by nb_colsD\"","typeGuard":null,"tryCatchPattern":"try { run(expr) } catch (CImgArgumentException &e) { log(e.what()); }","preventionTips":["Allocate destinations with exact rows*cols","Recheck nb_colsD after refactors","Avoid reusing destination buffers across ops"],"tags":["cimg","math-parser","dimension-mismatch"],"backgroundTag":"tensor-shape-mismatch","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"}