Xah Talk Show 2019-12-09 emacs lisp live coding + tutorial. command to convert png to jpg while in html buffer

emacs lisp live coding + tutorial. command to convert png to jpg while in html buffer 2019-12-09

topics talked:

(defun xah-convert-png-to-jpg-inline ()
  "convert the image file under cursor in a html file, from jpg to png, then, linkify it in html.
Version 2019-12-09"
  (interactive)
  (let (
        inputPath
        cmdStr
        fileCoreName
        )
    (setq inputPath (thing-at-point 'filename))
    (setq fileCoreName (file-name-sans-extension inputPath))
    (setq cmdStr (format "convert %s.png %s.jpg" fileCoreName fileCoreName ))
    (shell-command cmdStr )
    (when (yes-or-no-p "Delete the png file?")
      (delete-file inputPath))
    (search-backward "<" )
    (insert fileCoreName ".jpg")
    (insert "\n")
    (backward-char 2)
    (xah-html-image-linkify)
    ;;
    ))

xah_talk_show_2019-12-09.txt

xah talk show 2019-12-09 3jzdm
Xah Talk Show 2019-12-09