Function: org-odt--copy-image-file

org-odt--copy-image-file is a byte-compiled function defined in ox-odt.el.gz.

Signature

(org-odt--copy-image-file PATH)

Documentation

Return the internal name of the file.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-odt.el.gz
;;;; Links :: Inline Images

(defun org-odt--copy-image-file (path)
  "Return the internal name of the file."
  (let* ((image-type (file-name-extension path))
	 (media-type (format "image/%s" image-type))
	 (target-dir "Images/")
	 (target-file
	  (format "%s%04d.%s" target-dir
		  (cl-incf org-odt-embedded-images-count) image-type)))
    (message "Embedding %s as %s..."
	     (substring-no-properties path) target-file)

    (when (= 1 org-odt-embedded-images-count)
      (make-directory (concat org-odt-zip-dir target-dir))
      (org-odt-create-manifest-file-entry "" target-dir))

    (copy-file path (concat org-odt-zip-dir target-file) 'overwrite)
    (org-odt-create-manifest-file-entry media-type target-file)
    target-file))