diff --git a/CImg.h b/CImg.h index 43b08c5720a34690e1d0da82f706d3fd418ef343..54da20a9dc8f836038081358dfff6f39878cc593 100644 --- a/CImg.h +++ b/CImg.h @@ -17603,7 +17603,7 @@ namespace cimg_library_suffixed { arg1 = p1 = compile(ss5,s1,depth1,ref,is_single); s2 = ++s1; while (s2<se1 && (*s2!=',' || level[s2 - expr._data]!=clevel1)) ++s2; arg2 = compile(s1,s2,depth1,ref._data + 7,is_single); - arg3 = ~0U; arg4 = arg5 = arg6 = 1; + arg3 = arg4 = arg5 = ~0U; arg6 = 1; if (s2<se1) { s3 = ++s2; while (s3<se1 && (*s3!=',' || level[s3 - expr._data]!=clevel1)) ++s3; arg3 = compile(s2,s3,depth1,0,is_single); @@ -17617,12 +17617,18 @@ namespace cimg_library_suffixed { } } } - if (_cimg_mp_is_vector(arg1) && !ref[0]) ++arg1; + if (_cimg_mp_is_vector(arg1)) { + if (!ref[0]) ++arg1; + else if (ref[0]>=4 && arg4==~0U) arg4 = scalar1(mp_image_whd,ref[1]); + } if (_cimg_mp_is_vector(arg2)) { if (arg3==~0U) arg3 = constant(_cimg_mp_size(arg2)); if (!ref[7]) ++arg2; + if (ref[7]>=4 && arg5==~0U) arg5 = scalar1(mp_image_whd,ref[8]); } if (arg3==~0U) arg3 = 1; + if (arg4==~0U) arg4 = 1; + if (arg5==~0U) arg5 = 1; _cimg_mp_check_type(arg3,3,1,0); _cimg_mp_check_type(arg4,4,1,0); _cimg_mp_check_type(arg5,5,1,0);