MATLAB - Error writing to file using jpeg_write

主宰稳场 提交于 2021-01-07 02:42:14

问题


Recently I added jpeg toolbox to Matlab for Mac OS. for jpeg_read.mexmaci64 I followed this and for jpeg_write.mexmaci64 this. everything was fine but at runtime I got an error like this:

Error using jpeg_write
Error writing to file.

I don't know why Matlab returns this and how Im supposed to fix it. when I compiled jpeg_write.c file to create jpeg_write.mexmaci64, mex operation completed successfully but there was a warning like this. maybe its relevant to the error.

Building with 'Xcode with Clang'.
/Users/folder/jpeg_toolbox/jpeg_write.c:355:42: warning: passing 'char *' to parameter of type 'const JOCTET *' (aka 'const unsigned char *') converts between pointers to integer types with different sign [-Wpointer-sign]
     jpeg_write_marker(&cinfo, JPEG_COM, comment, strlen-1);
                                         ^~~~~~~
/usr/local/opt/jpeg/include/jpeglib.h:1031:22: note: passing argument to parameter 'dataptr' here
             const JOCTET * dataptr, unsigned int datalen));
                            ^
1 warning generated.

MEX completed successfully.

来源:https://stackoverflow.com/questions/64820620/matlab-error-writing-to-file-using-jpeg-write

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!