summaryrefslogtreecommitdiff
path: root/lisp/image.el
Commit message (Collapse)AuthorAgeFilesLines
* Add new function image-supported-file-pLars Ingebrigtsen2022-03-221-1/+16
| | | | | | | | | | | | | * lisp/image.el (image-type-from-file-name): Make obsolete. (image-supported-file-p): New function that has a more sensible value. (image-type): Adjust caller. * lisp/thumbs.el (thumbs-file-size, thumbs-show-image-num): Adjust callers. * lisp/mail/rmailmm.el (rmail-mime-set-bulk-data): Adjust caller and logic.
* Revert "Allow using image-convert to view .bmp images"Lars Ingebrigtsen2022-03-221-9/+9
| | | | | | | This reverts commit ede8ad507d06a336ce8202927f214aecbaf15d6b. This leads to failures for usages of the function where Emacs doesn't have support for the formats.
* Allow specifying the intermediate formatLars Ingebrigtsen2022-03-211-1/+2
| | | | | | | * lisp/image/image-converter.el (image-convert-to-format): New user format (bug#54494). (image-convert, image-converter--convert-magick) (image-converter--convert): Use it.
* Allow using image-convert to view .bmp imagesLars Ingebrigtsen2022-03-211-9/+9
| | | | | * lisp/image.el (image-type-from-file-name): Allow Emacs to fall back on image-convert to display .bmp images (bug#54492).
* * lisp/image.el (image-map): Use defvar-keymap.Stefan Kangas2022-01-311-12/+10
|
* Merge from origin/emacs-28Stefan Kangas2022-01-251-2/+3
|\ | | | | | | | | c34d06e3d7 * configure.ac (LIBSECCOMP): Bump minimum version for facc... 335a5a9e0f Make the `f' command work in image-mode again
| * Make the `f' command work in image-mode againLars Ingebrigtsen2022-01-241-2/+3
| | | | | | | | | | * lisp/image.el (image-show-frame): Protect against not having computed the animation data yed (bug#53489).
* | Merge from origin/emacs-28Eli Zaretskii2022-01-011-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
| |
* | Add native HEIC support on macOS (bug#51381)Alan Third2021-12-221-3/+4
| | | | | | | | | | | | | | | | | | * lisp/image.el (image-type-header-regexps): (image-type-file-name-regexps): (image-type-auto-detectable): Add auto-detect code for heic. * src/image.c (syms_of_image): Add heic as an image type under NS. * src/nsimage.m (ns_can_use_native_image_api): Add heic to list of possible image types in the native image support lookup.
* | Fix image load timekeeping bugPaul Eggert2021-12-051-3/+3
| | | | | | | | | | | | | | * lisp/image.el (image-animate-timeout): Fix bug that caused the local variable time-to-load-image to be practically zero, instead of the time it actually took to load the image. I think this bug was introduced in 2013-02-16T03:29:30Z!rgm@gnu.org.
* | * lisp/image.el (image): Add :prefix and :link.Stefan Kangas2021-12-031-0/+2
| |
* | Allow stopping animations automatically when the image disappearsLars Ingebrigtsen2021-11-121-37/+57
| | | | | | | | | | | | | | | | | | | | * lisp/image.el (image-animate): Allow the animation to be stopped automatically when the image is removed from the buffer. (image-animate-timeout): Stop the animation if the image is removed (and that has been requested). * lisp/net/shr.el (shr-put-image): Stop animations if the image is removed.
* | Make image-compute-scaling-factor argument optionalLars Ingebrigtsen2021-11-091-1/+6
| | | | | | | | | | * lisp/image.el (image-compute-scaling-factor): Make the argument optional.
* | Allow 'insert-image' to inhibit isearches or notLars Ingebrigtsen2021-11-061-3/+7
| | | | | | | | | | | | * doc/lispref/display.texi (Showing Images): Mention it. * lisp/image.el (insert-image): Take an optional parameter to inhibit isearch of the STRING argument.
* | Introduce a new 'inhibit-isearch' text propertyLars Ingebrigtsen2021-11-061-0/+1
| | | | | | | | | | | | | | | | | | | | * doc/lispref/text.texi (Special Properties): Mention it. * lisp/image.el (insert-image): Make `C-s' skip over the image data. * lisp/isearch.el (isearch--search-skip-inhibited): New function. (isearch-search-string): Use it. (isearch--invisible-p): New function. (isearch-range-invisible): Use it.
* | Add new function image-at-point-pStefan Kangas2021-10-271-0/+7
| | | | | | | | | | * lisp/image.el (image-at-point-p): New defun. * doc/lispref/display.texi (Showing Images): Document above new defun.
* | Add WebP image format support (Bug#51296)Stefan Kangas2021-10-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (--with-webp): New option. (HAVE_WEBP): New variable. (emacs_config_features): Add webp. * src/image.c (enum webp_keyword_index) [HAVE_WEBP]: New enum. (webp_format) [HAVE_WEBP]: New variable. (webp_image_p, init_webp_functions, webp_load) [HAVE_WEBP]: New functions for WebP support. (image_types) [HAVE_WEBP]: Define WebP format. (syms_of_image) <Qwebp> [HAVE_WEBP]: New DEFSYM. Add image type Qwebp. * src/Makefile.in (LIBIMAGE): Add WEBP_LIBS. * lisp/files.el (auto-mode-alist): * lisp/image-file.el (image-file-name-extensions): * lisp/image.el (image-type-header-regexps) (image-type-file-name-regexps, image-type-auto-detectable): Add WebP support. * lisp/term/w32-win.el (dynamic-library-alist): Add the libwebp DLL. * INSTALL: * admin/CPP-DEFINES: * doc/lispref/display.texi (Image Formats, Other Image Types): * nt/INSTALL: Document WebP support. * test/lisp/image-tests.el (image-find-image) (image-type-from-file-name): Expand tests. * test/src/image-tests.el (image-tests--files): Add WebP. (image-tests-image-size/webp, image-tests-image-mask-p/webp) (image-tests-image-metadata/webp): New tests. * test/data/image/black.webp: New file.
* | Mark def* macros for indentationLars Ingebrigtsen2021-10-131-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/widget.el (define-widget-keywords): * lisp/vc/pcvs.el (defun-cvs-mode): * lisp/subr.el (defvar-local): (defvar-keymap): * lisp/skeleton.el (define-skeleton): * lisp/simple.el (define-alternatives): * lisp/progmodes/gud.el (gdb-script-mode): * lisp/progmodes/gdb-mi.el (def-gdb-preempt-display-buffer): (def-gdb-auto-update-trigger): (def-gdb-auto-update-handler): (def-gdb-trigger-and-handler): (def-gdb-thread-buffer-command): (def-gdb-thread-buffer-simple-command): (def-gdb-thread-buffer-gud-command): (def-gdb-set-positive-number): (def-gdb-memory-format): (def-gdb-memory-unit): (def-gdb-memory-show-page): * lisp/progmodes/compile.el (define-compilation-mode): * lisp/progmodes/cc-vars.el (defcustom-c-stylevar): * lisp/obsolete/cl.el (define-setf-expander): (defsetf): (define-modify-macro): * lisp/obsolete/cl-compat.el (defkeyword): * lisp/net/hmac-def.el (define-hmac-function): * lisp/international/mule-conf.el (define-iso-single-byte-charset): * lisp/international/ccl.el (define-ccl-program): * lisp/image.el (defimage): * lisp/gnus/gmm-utils.el (defun-gmm): * lisp/ezimage.el (defezimage): * lisp/erc/erc.el (define-erc-module): * lisp/emacs-lisp/shortdoc.el (define-short-documentation-group): * lisp/emacs-lisp/eieio.el (defclass): * lisp/emacs-lisp/eieio-compat.el (defgeneric): (defmethod): * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): (define-globalized-minor-mode): * lisp/emacs-lisp/derived.el (define-derived-mode): * lisp/emacs-lisp/byte-run.el (defsubst): (define-obsolete-function-alias): (define-obsolete-variable-alias): * lisp/custom.el (defcustom): (defface): (defgroup): (deftheme): * lisp/cedet/semantic/wisent.el (define-wisent-lexer): * lisp/cedet/semantic/lex.el (define-lex): (define-lex-analyzer): (define-lex-regex-analyzer): (define-lex-simple-regex-analyzer): (define-lex-block-analyzer): (define-lex-keyword-type-analyzer): (define-lex-sexp-type-analyzer): (define-lex-regex-type-analyzer): (define-lex-string-type-analyzer): (define-lex-block-type-analyzer): * lisp/cedet/semantic/lex-spp.el (define-lex-spp-macro-declaration-analyzer): (define-lex-spp-macro-undeclaration-analyzer): (define-lex-spp-include-analyzer): * lisp/cedet/semantic/dep.el (defcustom-mode-local-semantic-dependency-system-include-path): * lisp/cedet/semantic/decorate/mode.el (define-semantic-decoration-style): * lisp/cedet/mode-local.el (define-child-mode): (define-overloadable-function): (define-mode-local-override): * lisp/calc/calc.el (defcalcmodevar): (defmath): Explicitly mark all macros that have names that start with "def" that should indent defunly-like (bug#43329).
* ; Minor stylistic fixes found by checkdocStefan Kangas2021-09-161-1/+1
|
* `image-save' doc string clarificationLars Ingebrigtsen2021-07-051-1/+3
| | | | | * lisp/image.el (image-save): Clarify what's being saved (bug#49347).
* Ensure updating the animated image in all windowsLars Ingebrigtsen2021-05-041-3/+1
| | | | | * lisp/image.el (image-show-frame): Simplify the window update -- pass in the buffer, which is a noop if the buffer isn't displayed.
* Speed up animation of non-displayed buffersLars Ingebrigtsen2021-05-031-1/+3
| | | | | | * lisp/image.el (image-show-frame): Don't force an update if the buffer with the animation isn't in a window (bug#47895). Also just update the window in question.
* Speed up animation of non-displayed imagesLars Ingebrigtsen2021-05-031-5/+9
| | | | | | * lisp/image.el (image-animate): Only compute the animation data once -- this avoids recomputing the image on every iteration when the image is not displayed (bug#47895).
* Clarify the doc string of insert-imageLars Ingebrigtsen2021-04-041-2/+6
| | | | | * lisp/image.el (insert-image): Mention the effect of a whitespace image (bug#47240).
* Address some --without-x byte-compilation warningsBasil L. Contovounesios2021-03-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | These came to light in the contexts of bug#29713 and bug#47234. * lisp/emulation/edt-mapper.el (edt-xserver): * lisp/emulation/edt.el (edt-xserver): * lisp/gnus/gnus-util.el (gnus-rescale-image): * lisp/gnus/nnimap.el (nnimap-map-port): * lisp/term/w32-win.el: * lisp/image.el (image--get-imagemagick-and-warn): * lisp/frame.el (frame-notice-user-settings): Declare functions that are known to be present at runtime in GUI builds. (make-frame-on-display): Signal more informative error when called interactively in a non-GUI build (bug#29713). * lisp/international/mule-diag.el (describe-font): * lisp/org/org-macs.el (org--string-from-props): Pacify warnings about unknown functions in non-GUI bilds. * lisp/mh-e/mh-mime.el (mh-small-image-p): Avoid eliminating fboundp check in non-GUI builds, to pacify unused lexical variable warning. * lisp/net/newst-plainview.el (newsticker--plainview-tool-bar-map): * lisp/net/newst-treeview.el (newsticker-treeview-tool-bar-map): Declare tool-bar-map as a special variable in non-GUI builds.
* Add a new `image-transform-smoothing' user optionLars Ingebrigtsen2021-03-121-5/+46
| | | | | | | * doc/lispref/display.texi (Image Descriptors): Document it. * lisp/image.el (image-transform-smoothing): New user option. (create-image): Use it. (image--default-smoothing): New function.
* Move the ‘declare’ form before the interactive spec in 10 functions.Juri Linkov2021-01-201-1/+1
| | | | | | | | | | | | * lisp/emacs-lisp/package.el (package-menu-hide-package): * lisp/font-lock.el (font-lock-debug-fontify): * lisp/image.el (image-jpeg-p): * lisp/mail/flow-fill.el (fill-flowed-test): * lisp/mh-e/mh-speed.el (mh-speed-toggle, mh-speed-view): * lisp/progmodes/project.el (project-async-shell-command) (project-shell-command, project-compile): * lisp/progmodes/sh-script.el (sh-assignment): Fix special forms to follow in this order: docstring, declare, interactive.
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Cache toolbar icon data pathsLars Ingebrigtsen2020-12-081-18/+27
| | | | | | | | * lisp/image.el (find-image): Add an optional CACHE parameter. (find-image--cache): New variable. * lisp/tool-bar.el (tool-bar--image-expression): Use cached data to avoid looking up the image files on each refresh.
* Merge from origin/emacs-27Glenn Morris2020-10-021-1/+1
|\ | | | | | | | | | | | | | | | | 78eacf31e8 ; Fix many typos in symbols in docs and comments d5d12707d6 * doc/misc/flymake.texi (Using Flymake): Fix a typo. (Bug... # Conflicts: # lisp/allout.el # lisp/progmodes/ebrowse.el
| * ; Fix many typos in symbols in docs and commentsStefan Kangas2020-10-021-1/+1
| |
* | Use a new method to determine when to auto-stop image animationsLars Ingebrigtsen2020-07-291-2/+8
|/ | | | | | | * lisp/image.el (image-animate-timeout): Make the animation auto-stop use a decaying average to determine when to stop (bug#40685). The default stop condition will probably require some tweaking -- the current default may be too aggressive.
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* * lisp/image.el: Support image scaling with mouse in other buffer.Juri Linkov2019-11-301-12/+16
| | | | | | | | | | | * lisp/image.el (image-increase-size, image-decrease-size): Add optional arg position. (image-mouse-increase-size, image-mouse-decrease-size): Use '(point-marker)' for arg position. (image--get-image): Use get-char-property from position if non-nil, and its buffer. (image--get-imagemagick-and-warn, image--change-size): Add optional arg position.
* Use run-with-idle-timer instead of debounce for responsive image scaling.Juri Linkov2019-11-301-18/+28
| | | | | | | | | | | | | | | * lisp/emacs-lisp/timer.el (debounce, debounce-reduce): Revert macro addition. https://lists.gnu.org/archive/html/emacs-devel/2019-11/msg01133.html * lisp/image.el (image-increase-size, image-decrease-size): Use run-with-idle-timer. (image--change-size): Rename back from image--change-size-function. * lisp/image-mode.el (image-mode--setup-mode): Remove hooks window-size-change-functions and window-selection-change-functions (bug#32672) (image-fit-to-window): Rename from image--window-change-function. (image--window-state-change): Rename from image--window-change. Use run-with-idle-timer.
* Use new macro debounce-reduce to make mouse scaling of images more responsiveJuri Linkov2019-11-241-12/+18
| | | | | | | | | | * lisp/emacs-lisp/timer.el (debounce, debounce-reduce): New macros. * lisp/image.el (image-increase-size, image-decrease-size): Use funcall to call image--change-size-function. (image--change-size-function): Move code from defun of image--change-size to defvar that has the value of lambda returned from debounce-reduce. (Bug#38187)
* Fix loading image-converter in the case where the type is passed inLars Ingebrigtsen2019-11-211-0/+1
| | | | | * lisp/image.el (create-image): Load image-converter when converting images (bug#38310).
* * lisp/image.el: Mouse-wheel scaling on images (bug#38187)Juri Linkov2019-11-211-4/+24
| | | | | | | | * lisp/image.el (image-mouse-increase-size) (image-mouse-decrease-size): New commands. (image-map): Bind C-wheel-down and C-mouse-5 to image-mouse-decrease-size, C-wheel-up and C-mouse-4 to image-mouse-increase-size.
* Allow eww to display exotic images like webpLars Ingebrigtsen2019-11-191-12/+26
| | | | | | | | | | | | | * lisp/image.el (image-type): Allow passing in the image type. (create-image): Make conversion work with data in addition to files. * lisp/image/image-converter.el (image-convert-p): Allow taking working on data in addition to files (bug#38036). (image-convert): Ditto. (image-converter--convert): Extend signature to say whether we're getting a file or data. (image-converter--convert-magick): Convert data. (image-converter--convert): Ditto.
* Default exotic image formats (like .webp) to image-modeLars Ingebrigtsen2019-10-291-1/+3
| | | | | | | | | | | | | | | | | | * doc/lispref/errors.texi (Standard Errors): Mention the new error. * lisp/files.el (auto-mode-alist): Add a bunch of image suffixes to the list (bug#37972) based on the output from "gm convert -list format" (i.e., graphicsmagick). * lisp/image-mode.el (image-mode): Rewrite to possibly notify the user about image-use-external-converter. (image-mode--setup-mode): Factor out into own function and don't run under `condition-case' as there's nothing here that should error. * lisp/image.el (unknown-image-type): New error. (image-type): Signal that error so that image-mode can offer sensible feedback to the user.
* lisp/*.el, src/*.c: Doc fixes related to returning t vs non-nilJuanma Barranquero2019-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/flymake-proc.el (flymake-proc--find-buffer-for-file): Doc fix; return value is a buffer, not t. * lisp/progmodes/ebrowse.el (ebrowse-member-display-p): Doc fix; return value is the MEMBER argument, not nil. * lisp/files.el (hack-one-local-variable-eval-safep): * lisp/play/doctor.el (doctor-nounp, doctor-pronounp): * lisp/progmodes/flymake-proc.el (flymake-proc--check-include): * lisp/progmodes/js.el (js--broken-arrow-terminates-line-p): Doc fix; a non-nil return value is not always t. * lisp/image.el (image-type-available-p): * lisp/simple.el (region-active-p): * lisp/window.el (frame-root-window-p): * src/buffer.c (Fbuffer_live_p): * src/image.c (Finit_image_library): * src/window.c (Fwindow_minibuffer_p): Doc fix; a non-nil return value is always t. * doc/lispref/minibuf.texi (Minibuffer Windows): Doc fix.
* Correct some custom type typosRobert Pluim2019-10-011-1/+1
| | | | | | | | | | * lisp/image.el (image-use-external-converter): * lisp/progmodes/sql.el (sql-use-indent-support): * lisp/vc/add-log.el (add-log-dont-create-changelog-file): Fix misspelled 'boolean custom type. * lisp/progmodes/flymake-cc.el (flymake-cc-command): Correct custom type specification. (Bug#30990)
* Rename the new convert-images-externally variableLars Ingebrigtsen2019-09-301-2/+2
| | | | | | | * doc/emacs/files.texi (File Conveniences): Adjust documentation. * lisp/image.el (image-use-external-converter): Rename from convert-images-externally.
* Improve documentation of image conversion featureEli Zaretskii2019-09-291-5/+5
| | | | | | | | | * lisp/image/image-converter.el (image-converter) (image-convert-p, image-convert): * lisp/image.el (convert-images-externally): * etc/NEWS: * doc/lispref/display.texi (Defining Images): Fix recently added documentation.
* Remove :group from a recent defcustomLars Ingebrigtsen2019-09-291-1/+0
| | | | * lisp/image.el (convert-images-externally): Remove :group.
* If requested, use external image converters for exotic formatsLars Ingebrigtsen2019-09-291-4/+30
| | | | | | | | | | * doc/lispref/display.texi (Defining Images): Document it. * lisp/image.el (convert-images-externally): New variable. (image-type): Use it. (create-image): Convert images. * lisp/image/image-converter.el (image-converter--convert): New file.
* Make the image keymaps not extend after the imageLars Ingebrigtsen2019-07-281-1/+1
| | | | | | * lisp/image.el (insert-image): Make all the properties rear-nonsticky. Before this change, the keymap would extend after the image.
* Allow counter-clockwise rotations in image-rotateBasil L. Contovounesios2019-07-201-9/+13
| | | | | | | | * lisp/image.el (image-rotate): Extend with an optional argument specifying the rotation in degrees (bug#35421). * doc/lispref/display.texi (Showing Images): * etc/NEWS: Document the change. * test/lisp/image-tests.el (image-rotate): New test.
* Add native image rotation and croppingAlan Third2019-06-051-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/image.el (image--get-imagemagick-and-warn): Only fallback to ImageMagick if native transforms aren't available. * src/dispextern.h (INIT_MATRIX, COPY_MATRIX, MULT_MATRICES): New macros for matrix manipulation. (HAVE_NATIVE_SCALING, HAVE_NATIVE_TRANSFORMS): Rename and change all relevant locations. * src/image.c (x_set_image_rotation): (x_set_transform): New functions. (x_set_image_size): Use transform matrix for resizing under X and NS. (x_set_image_crop): New function. (lookup_image): Use the new transform functions. (Fimage_scaling_p, Fimage_transforms_p): Rename and update all callers. * src/nsimage.m (ns_load_image): Remove rotation code. (ns_image_set_transform): New function. ([EmacsImage dealloc]): Release the saved transform. ([EmacsImage rotate:]): Remove unneeded method. ([EmacsImage setTransform:]): New method. * src/nsterm.h (EmacsImage): Add transform property and update method definitions. * src/nsterm.m (ns_dumpglyphs_image): Use the transform to draw the image correctly. * src/xterm.c (x_composite_image): Use PictOpSrc as we don't care about alpha values here. * doc/lispref/display.texi (Image Descriptors): Add :rotation. (ImageMagick Images): Remove :rotation.