Open nikclayton opened 5 years ago
Converting them to data URIs is easy, the problem is that write.as ignores <img>
tags.
#+BEGIN_SRC emacs-lisp :results verbatim :exports both
(defun tob64 (filename)
(base64-encode-string
(with-temp-buffer
(insert-file-contents filename)
(buffer-string))))
(format "<img src=\"data:image/png;base64,%s\">"
(tob64 "/path/to/img"))
#+END_SRC
If their snap.as service would offer an API, it'd be possible to upload images and link them. However the service is not free and doesn't have an API yet. An alternative would be imgur, but not sure if that's not against their terms of service. Ideas?
I opened an issue over there about that -- https://github.com/writeas/writefreely/issues/80.
Since write.as doesn't support hosting images directly, it would be handy if images linked to from the Org file were converted to data: URIs when the content is uploaded.