Everything works perfectly in OSX, but I can't convert anything but the most simple emf in Windows 11 and Wine in OSX.
I'm using https://github.com/mstorsjo/llvm-mingw to compile this project.
I tried with https://github.com/VasiliyLu/Emf2SvgConverter/tree/main/Emf2SvgLibrary/runtimes/win-x64/native -files and they give the same error, so I don't think this is my toolchain problem.
I changed src\lib\emf2svg.c to print more info from the error:
result = U_emf_onerec_draw(contents, blimit, recnum, off, stream, states);
if (result == (size_t)-1 || states->Error) {
if (states->verbose) {
printf("ABORTING(converting): invalid record - corrupted file?, size: %zu, %zu, error: %d\n", result, (size_t)-1, states->Error);
}
I tried to find the smallest emf, so I'm testing with test-009.emf file. Here is the result:
emf2svg start, input length is: 478
ABORTING(scanning): invalid record - corrupted file?
U_EMR_HEADER record: 0 type:1 offset: 0 rsize: 152
Status: PARTIAL SUPPORT
...
U_EMR_SELECTOBJECT record: 15 type:37 offset: 412 rsize: 12
Status: PARTIAL SUPPORT
ihObject: 3
U_EMR_POLYGON16 record: 16 type:86 offset: 424 rsize: 104
ABORTING(converting): invalid record - corrupted file?, size: 18446744073709551615, 18446744073709551615, error: 0
emf2svg done, buffer size is 384, result is 0
The result looks like there is some problem with the result size not being set correctly. Maybe some problems with mixing function result int with unsigned int size; and size_t off?
Everything works perfectly in OSX, but I can't convert anything but the most simple emf in Windows 11 and Wine in OSX. I'm using
https://github.com/mstorsjo/llvm-mingw
to compile this project.I tried with
https://github.com/VasiliyLu/Emf2SvgConverter/tree/main/Emf2SvgLibrary/runtimes/win-x64/native
-files and they give the same error, so I don't think this is my toolchain problem.I changed src\lib\emf2svg.c to print more info from the error:
I tried to find the smallest emf, so I'm testing with test-009.emf file. Here is the result:
The result looks like there is some problem with the result size not being set correctly. Maybe some problems with mixing function result int with unsigned int size; and size_t off?