MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / _mammoth_convert_image

Function _mammoth_convert_image

scripts/fetch_imdrf_fulltext.py:103–111  ·  view source on GitHub ↗

Custom mammoth image converter with compression.

(image)

Source from the content-addressed store, hash-verified

101
102
103def _mammoth_convert_image(image):
104 """Custom mammoth image converter with compression."""
105 with image.open() as f:
106 image_bytes = f.read()
107 alt_text = image.alt_text or ""
108 result = _compress_image(image_bytes, image.content_type, alt_text)
109 if not result:
110 return {}
111 return result
112
113
114def docx_to_markdown(docx_path: str) -> str:

Callers

nothing calls this directly

Calls 1

_compress_imageFunction · 0.85

Tested by

no test coverage detected