Embedded image lost when compiling R Markdown with Dot to HTML
57 views
Skip to first unread message
Steve
unread,
Feb 9, 2018, 11:33:45 AM2/9/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to knitr
I am having a very strange issue when trying to create a self-contained HTML document with embedded figures generated from GraphViz Dot code blocks. I am also having a hard time producing a MWE of the error, so here is a description of what is going on:
- using R Studio (Version1.0.143 on macOS);
R version 3.4.0 (2017-04-21) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS Sierra 10.12.5
- in the document, I have 3 small in-line Dot diagram code blocks, and one very large Dot diagram code block
- when I Knit to HTML, it produces the standard HTML output, along with a directory containing the images; however I assumed they are unused because typically the HTML output is in 'standalone' mode
- I emailed the HTML document to collaborators for review
- when I double checked the email attachment file on another computer, everything looks fine, except the largest of the diagrams is showing the 'broken image' icon and the image is not appearing
- I save the HTML email attachment, open it in Chrome, and the image is still not showing. When I right-click on the broken image icon in its place and 'Open Image in New Tab', I get this:
This site can’t be reached The webpage at data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABZUAAANxCAYAAACcyFcEAAAAAXNSR0IArs4c6QAAQABJREFUeAHs3Qm8TdX///GPkFkks0yZSaZGGVIqUYpKRaNooHlQ+vYVDaI0fSmVFE2UX5EmRZFoUIRIqZBGQySZOf/9Xv/vPt9zj3vOPffec+89w2s9Hqezz95rr732c59zq89e+7MKBbxiFAQQQAABBBBAAAEE ..... ..... RKBERABERABERABERABERABERABERABERABERABETACciprK+BCIiACIiACIiACIiACIiACIiACIiACIiACIiACIhA0QT+HwwqRodse7rcAAAAAElFTkSuQmCC might be temporarily down or it may have moved permanently to a new web address. ERR_INVALID_URL
Any idea what might be happening? The .png embedded figures for the smaller diagrams are only 60KB, but this one is 160KB; is there a size limit? I opened the HTML document source and the base64 embedded figure code is indeed present, maybe part of it did not get saved?
When I re-compile the document locally and view the HTML output, it looks fine. I tried re-compiling the HTML, moving the HTML file, and then renaming it, and in one case the image broke again, in another case it didnt. I also tried removing all the text from the document and leaving only the images, and doing the same; in those cases the images all loaded fine. I am kind of lost as to what is going on here.
On the other hand, I have no issues if I compile to PDF.