Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ZRBzrb6119 opened this issue Apr 18, 2024 · 2 comments
Closed

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

ZRBzrb6119 opened this issue Apr 18, 2024 · 2 comments

Comments

@ZRBzrb6119
Copy link

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
Copy link
Owner

jmcnamara commented Apr 18, 2024

Some questions:

  • Is the image type in the buffer actually supported by libxlsxwriter/Excel?
  • If so what happens if you dump the image to a file and then create a simple hello world program that inserts the image from the file (not buffer)?
  • Could you attach a sample image that is failing?

@jmcnamara
Copy link
Owner

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

@jmcnamara jmcnamara closed this as not planned Won't fix, can't repro, duplicate, stale Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants