Current File : //proc/self/root/kunden/usr/share/emacs/27.2/lisp/image/image-converter.elc |
;ELC
;;; Compiled
;;; in Emacs version 27.2
;;; with all optimizations.
;;; This file uses dynamic docstrings, first added in Emacs 19.29.
;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(byte-code "\300\301!\210\302\303\304\305\306DD\307\310\311\312\313\314\315& \207" [require cl-generic custom-declare-variable image-converter funcall function #[0 "\300\207" [nil] 1] "Type of the external image converter to use.\nThe value should a symbol, either `imagemagick', `graphicsmagick',\nor `ffmpeg'.\nIf nil, Emacs will try to find one of the supported converters\ninstalled on the system." :group image :type symbol :version "27.1"] 10)
#@69 A regexp that matches the file name suffixes that can be converted.
(defvar image-converter-regexp nil (#$ . 858))
#@44 List of supported image converters to try.
(defvar image-converter--converters '((graphicsmagick :command ("gm" "convert") :probe ("-list" "format")) (ffmpeg :command "ffmpeg" :probe "-decoders") (imagemagick :command "convert" :probe ("-list" "format"))) (#$ . 979))
#@290 Return `image-convert' if SOURCE is an image that can be converted.
SOURCE can either be a file name or a string containing image
data. In the latter case, DATA-P should be non-nil. If DATA-P
is a string, it should be a MIME format string like
"image/gif".
(fn SOURCE &optional DATA-P)
(defalias 'image-convert-p #[513 "\204 \302 \210\203 \204 \303!\211\203 \304\305!\306Q\210\205K \211\204- \307 \"\204J \211\205K \2119\205K \307\310\311!\"\205K \307 \312\313!P\"\205K \314\207" [image-converter image-converter-regexp image-converter--find-converter image-converter--probe "\\." regexp-opt "\\'" string-match "/" symbol-name "foo." image-converter--mime-type image-convert] 7 (#$ . 1254)])
#@492 Convert IMAGE file to the PNG format.
IMAGE can either be a file name or image data.
To pass in image data, IMAGE should a string containing the image
data, and IMAGE-FORMAT should be a symbol with a MIME format name
like "image/webp". For instance:
(image-convert data-string 'image/bmp)
IMAGE can also be an image object as returned by `create-image'.
This function converts the image to PNG, and the converted image
data is returned as a string.
(fn IMAGE &optional IMAGE-FORMAT)
(defalias 'image-convert #[513 "\204 \301 \210\204 \302\303!\210\211\203# \304\305!\306\"G\307U\204# \302\310!\210\311\312!r\211q\210\313\314\315\316\317!\320\"\307$\216\321\322!\210\323<\203I \324A\325\"\202J <\203X \324A\326\"\202Y #\211\203c \302\327\"\210\210<\203\251 \330\331\332 \333\334A\322\211\211\211:\203\241 \262\211A\262\242\262@\262\335=\204\231 \336D!\244\262AA\262\202v \211\237\266\205%\202\253 \332 *\207" [image-converter image-converter--find-converter error "No external image converters available" split-string symbol-name "/" 2 "IMAGE-FORMAT should be a symbol like `image/png'" generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] set-buffer-multibyte nil image-converter--convert plist-get :file :data-p "%s" apply create-image buffer-string png t :type reverse] 16 (#$ . 1970)])
#@67 Return the value of ELEM of image converter TYPE.
(fn TYPE ELEM)
(defalias 'image-converter--value #[514 "\301\236A\"\211;\203 \211C\202 \211\207" [image-converter--converters plist-get] 5 (#$ . 3372)])
(byte-code "\300\301\302\303\302\304%\210\300\301\302\305\302\306%\210\300\301\302\307\302\310%\207" [cl-generic-define-method image-converter--probe nil ((type (eql graphicsmagick))) #[257 "\300\301!r\211q\210\302\303\304\305\306!\307\"\310$\216\311\312\"\313\314@!\205Z \315\316@\313\317\313\320A\311\f\321\"\"&\303U\205Z eb\210\322\323\313\324#\203X \325y\210\322\326\313\324#\203X \327\325!\227B\262\202E \211\237\266\202*\207" [generate-new-buffer #1=" *temp*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 image-converter--value :command nil executable-find apply call-process (t nil) append :probe re-search-forward "^-" t 1 "^ *\\([A-Z0-9]+\\) +. +r" match-string] 15 "Check whether the system has GraphicsMagick installed.\n\n(fn TYPE)"] ((type (eql imagemagick))) #[257 "\300\301!r\211q\210\302\303\304\305\306!\307\"\310$\216\311\312\"\313\314@!\2033 \315\316@\313\317\313\320A\311\f\321\"\"&\210eb\210\322\323\313\324#\203T \325y\210\322\326\313\324#\203T \327\325!\227B\262\202A \211\237\266\202*\207" [generate-new-buffer #1# make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 image-converter--value :command nil executable-find apply call-process (t nil) append :probe re-search-forward "^-" t 1 "^ *\\([A-Z0-9]+\\)\\*?\\(?: +[A-Z0-9]+\\)? +r" match-string] 15 "Check whether the system has ImageMagick installed.\n\n(fn TYPE)"] ((type (eql ffmpeg))) #[257 "\300\301!r\211q\210\302\303\304\305\306!\307\"\310$\216\311\312\"\313\314@!\205Y \315\316@\313\317\313\320A\311\f\321\"\"&\303U\205Y eb\210\322\323\313\324#\203W \325y\210\322\326\313\324#\203W \327\325!B\262\202E \211\237\266\202*\207" [generate-new-buffer #1# make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 image-converter--value :command nil executable-find apply call-process (t nil) append :probe re-search-forward "^ *-" t 1 "^ *V[^ ]+ +\\([a-z0-9_]+\\)" match-string] 15 "Check whether the system has ffmpeg installed.\n\n(fn TYPE)"]] 6)
#@36 Find an installed image converter.
(defalias 'image-converter--find-converter #[0 "\3032- \211\205* \211@\304@!\211\203\"