@@ -29311,7 +29311,7 @@ namespace cimg_library {
2931129311 ptrd = (unsigned int)mp.opcode[1] + 1,
2931229312 siz = (unsigned int)mp.opcode[2];
2931329313 mp_func op = (mp_func)mp.opcode[3];
29314- ulongT l_data[3];
29314+ ulongT l_data[3] = { 0 } ;
2931529315 CImg<ulongT> l_opcode(l_data,1,3,1,1,true);
2931629316 l_opcode[2] = mp.opcode[4]; // Scalar argument
2931729317 l_opcode.swap(mp.opcode);
@@ -29327,7 +29327,7 @@ namespace cimg_library {
2932729327 siz = (unsigned int)mp.opcode[2],
2932829328 ptrs = (unsigned int)mp.opcode[4] + 1;
2932929329 mp_func op = (mp_func)mp.opcode[3];
29330- ulongT l_data[4];
29330+ ulongT l_data[4] = { 0 } ;
2933129331 CImg<ulongT> l_opcode(l_data,1,4,1,1,true);
2933229332 l_opcode.swap(mp.opcode);
2933329333 ulongT &target = mp.opcode[1], &argument = mp.opcode[2];
@@ -57214,7 +57214,6 @@ namespace cimg_library {
5721457214 throw CImgArgumentException(_cimg_instance
5721557215 "load_png(): Specified filename is (null).",
5721657216 cimg_instance);
57217-
5721857217#ifndef cimg_use_png
5721957218 cimg::unused(bits_per_value);
5722057219 if (file)
@@ -59673,7 +59672,7 @@ namespace cimg_library {
5967359672#endif
5967459673 );
5967559674 } while (cimg::path_exists(filename_tmp));
59676- cimg_snprintf(command,command._width,"\"%s\" %s \"%s\" \"%s\"",
59675+ cimg_snprintf(command,command._width,"%s %s \"%s\" \"%s\"",
5967759676 magick_path,
5967859677 !cimg::strcasecmp(cimg::split_filename(filename),"pdf")?" -density 400x400":"",
5967959678 s_filename.data(),
@@ -63649,7 +63648,7 @@ namespace cimg_library {
6364963648 save_pnm(filename_tmp);
6365063649#endif
6365163650 const char *magick_path = cimg::imagemagick_path();
63652- cimg_snprintf(command,command._width,"\"%s\" -quality %u \"%s\" \"%s\"",
63651+ cimg_snprintf(command,command._width,"%s -quality %u \"%s\" \"%s\"",
6365363652 magick_path,quality,
6365463653 CImg<charT>::string(filename_tmp)._system_strescape().data(),
6365563654 CImg<charT>::string(filename)._system_strescape().data());
@@ -67399,7 +67398,7 @@ namespace cimg_library {
6739967398 cimg::graphicsmagick_path(),
6740067399 CImg<charT>::string(filename)._system_strescape().data(),
6740167400 CImg<charT>::string(filename_tmp)._system_strescape().data());
67402- else cimg_snprintf(command,command._width,"\"%s\" -coalesce \"%s\" \"%s.png\"",
67401+ else cimg_snprintf(command,command._width,"%s -coalesce \"%s\" \"%s.png\"",
6740367402 cimg::imagemagick_path(),
6740467403 CImg<charT>::string(filename)._system_strescape().data(),
6740567404 CImg<charT>::string(filename_tmp)._system_strescape().data());
@@ -67908,7 +67907,7 @@ namespace cimg_library {
6790867907 frame.assign(frame.get_resize(-100,-100,1,4).draw_image(0,0,0,2,frame.get_shared_channel(0)),false);
6790967908 frame.save(filename_tmp2);
6791067909 }
67911- cimg_snprintf(command,command._width,"\"%s\" -delay %u -loop %u -dispose previous",
67910+ cimg_snprintf(command,command._width,"%s -delay %u -loop %u -dispose previous",
6791267911 cimg::imagemagick_path(),
6791367912 (unsigned int)std::max(0.f,cimg::round(100/fps)),
6791467913 nb_loops);
@@ -69525,6 +69524,18 @@ namespace cimg_library {
6952569524 if (!path_found) std::strcpy(s_path,"convert");
6952669525#endif
6952769526 winformat_string(s_path);
69527+
69528+ // Put path between double quotes and append ' convert' to it if necessary.
69529+ const unsigned int siz = (unsigned int)std::strlen(s_path);
69530+ const bool is_magick = std::strstr(s_path,"magick")?true:false;
69531+ CImg<char> s_path2(3 + siz + (is_magick?8:0));
69532+ char *s = s_path2._data;
69533+ *(s++) = '\"';
69534+ std::memcpy(s,s_path._data,siz); s+=siz;
69535+ *(s++) = '\"';
69536+ if (is_magick) { std::memcpy(s," convert",8); s+=8; }
69537+ *s = 0;
69538+ s_path2.move_to(s_path);
6952869539 }
6952969540 cimg::mutex(7,0);
6953069541 return s_path;
0 commit comments