I'm the maintainer of
puml-mode, a major mode for editing PlantUML files. It works by submitting the content of the current buffer to an external Java process, PlantUML, which then outputs an image to stdout. This image is then put in a newly created buffer to display.
While it correctly works for both SVG and ASCII art outputs, when I try to produce a PNG something goes wrong and the new buffer shows empty, with no error messages whatsoever. The weird thing is that when I
C-c C-c in the image buffer, I actually see the PNG as text, so the image is supposedly properly loaded.
When I manually open PNG files they correctly display as images.
Here's the relevant part of the code:
(defun puml-is-image-output-p () "Return true if the diagram output format is an image, false if it's text based." (not (equalp 'utxt (puml-output-type)))) ;; << feature detection, either 'png 'svg or 'utxt (defun puml-preview-sentinel (ps event) "For the PlantUML process (as PS) reacts on the termination event (as EVENT)." (if (equal event "finished\n") (progn (switch-to-buffer puml-preview-buffer) (when (and (display-images-p) (puml-is-image-output-p)) (image-mode))) (warn "PUML Preview failed: %s" event)))