Closed gnsiva closed 6 years ago
well it's called export to html after all but you could base64 the img bytes and add it to the img src attribute as "data:image/" . $fileExt . ";base64," . $base64data http://php.net/manual/en/function.base64-encode.php
Hi @gnsiva and @mendiromania,
Currently BookStack does attempt to Base64 embed images on the page for exports as shown here: https://github.com/BookStackApp/BookStack/blob/master/app/Services/ExportService.php#L182
If the image is not found then it's not base64 included.
@gnsiva, Just some questions to help debugging this issue:
APP_URL
environment variable at all?@ssddanbrown To quickly answer, I am using the full docker-compose. And regarding environment variables, I'm not setting anything other than what is set in the solidnerd setup.
@ssddanbrown Sorry, my bad, setting the APP_URL environment variable in the docker-compose file fixed the exporting. It is base64 encoding it too, hurrah! I will put in an issue to the solidnerd repo that setting the APP_URL should be in the instructions somewhere
@gnsiva Ah, Fantastic, Happy to hear things are working now. Will close this issue.
Thanks for your help!
For Bug Reports
This is using solidnerd/docker-bookstack
Expected Behavior
HTML export would contain images. These images are copy and pasted into the document, and so are uploaded into the bookstack uploads directory. This works correctly in normal use (expect for export).
Current Behavior
No images are visible in HTML export. When I inspect the html, I can see that it is a relative link which doesn't make sense for an export. e.g.
I guess there should be a way of configuring the server address so that this is filled in before
/uploads
? Also it would be nice if base64 encoding and embedding the images was also supported.Steps to Reproduce
Launch solidnerd version of bookstack docker container, paste an image into a bookstack page and try to html export.