jmcnamara / libxlsxwriter

A C library for creating Excel XLSX files.
https://libxlsxwriter.github.io
Other
1.48k stars 330 forks source link

How to insert image data of type CV:: Mat #439

Closed ZRBzrb6119 closed 4 months ago

ZRBzrb6119 commented 4 months ago

The byte data of type CV:: Mat seems to fail the image type verification if (memcmp(&signature[1], "PNG", 3) == 0) { if (_process_png(image_props) != LXW_NO_ERROR) return LXW_ERROR_IMAGE_DIMENSIONS; } else if (signature[0] == 0xFF && signature[1] == 0xD8) { if (_process_jpeg(image_props) != LXW_NO_ERROR) return LXW_ERROR_IMAGE_DIMENSIONS; } else if (memcmp(signature, "BM", 2) == 0) { if (_process_bmp(image_props) != LXW_NO_ERROR) return LXW_ERROR_IMAGE_DIMENSIONS; } else if (memcmp(signature, "GIF8", 4) == 0) { if (_process_gif(image_props) != LXW_NO_ERROR) return LXW_ERROR_IMAGE_DIMENSIONS; } else { LXW_WARN_FORMAT1("worksheet image insertion: " "unsupported image format for: %s.", image_props->filename); return LXW_ERROR_IMAGE_DIMENSIONS; }

jmcnamara commented 4 months ago

Some questions:

jmcnamara commented 4 months ago

Closing due to lack of feedback. I will reopen with a working example or if the questions above are answered.