Error writing to file using Jpeg_write.mexmaci64

조회 수: 7 (최근 30일)
Venus R
Venus R 2020년 11월 17일
편집: Venus R 2020년 11월 21일
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