问题
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