Error writing to file using Jpeg_write.mexmaci64

3 次查看(过去 30 天)
Recently i moved my project to mac OS so i needed to compile jpeg toolbox c++ files and create jpeg_read.mexmaci64 and jpeg_write.mexmaci64.
after a lot of search and try, finally i did that.
when i used mex for jpeg_write, the compilation successfully completed but there was a warning to. i dont know it is important or not.
mex -compatibleArrayDims -I/usr/local/opt/jpeg/include ...
-I/usr/local/opt/gdcm/include/gdcm-3.0/gdcmjpeg ...
jpeg_write.c ...
-L/usr/local/opt/jpeg/lib -L/usr/local/opt/gdcm/lib ...
-ljpeg -lgdcmjpeg16
Building with 'Xcode with Clang'.
/Users/venus/Downloads/jpeg_toolbox/jpeg_write.c:357: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.
but when i run my project MATLAB returns me an error when it comes to jpeg_write.
Error using jpeg_write
Error writing to file.
this is the code from my project when the error happens:
jpeg_write(jpegobj,[dirStego '/' regexprep(files(w).name,'.png','.jpg')]);
can anyone help me? im confused!!
  6 个评论
Walter Roberson
Walter Roberson 2020-11-20
I was able to get the code to compile without warning, but it crashed my MATLAB as soon as I did a jpeg_write, so unfortunately I do not have anything useful to hand over.
Venus R
Venus R 2020-11-21
编辑:Venus R 2020-11-21
Thank you for your help and try Walter. I tried the jpeg toolbox from the link. but nothing changed.
i have no idea why im getting this error.
if you find out the reason and the solution in the future, please let me know.
i will appreciate it.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Write C Functions Callable from MATLAB (MEX Files) 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by