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

Images are not visible/useable after PPTX to md conversion #246

Open
adamcvolz opened this issue Jan 2, 2025 · 0 comments
Open

Images are not visible/useable after PPTX to md conversion #246

adamcvolz opened this issue Jan 2, 2025 · 0 comments

Comments

@adamcvolz
Copy link

In the PPTX Converter convert function, this 'filename' placeholder is being placed inside of the content section for the md image object:
Image

Causing us to not have the ability to support images post process:
Image

In the shape.image object, we have content_type(file type), and blob(bytes). Could easily format a base64 encoded image here instead:

img_b64_string = base64.b64encode(image_bytes).decode('utf-8')
markdown_image = f"data:{content_type};base64,{b64_string}"
md_content += ( "\n![" + (alt_text if alt_text else shape.name) + "](markdown_image)\n" )

This would allow us to process images post conversion. Not sure if it was decided b64 encoded bytes wasn't ideal, but that can easily be extracted/converted/uploaded remotely etc. to a user's needs, and could even pass a flag to make it optionally supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant