diff options
| author | Lars Ingebrigtsen | 2022-09-14 18:33:09 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-09-14 18:33:33 +0200 |
| commit | 0df76e3e71de3051c70f8a055e155cb536fe3e1b (patch) | |
| tree | 22b72fd6c1516045acdff12f6a63cb91e9825e90 /lisp/image | |
| parent | 9148892768148f872e83293193c7f04b5add3d44 (diff) | |
| download | emacs-0df76e3e71de3051c70f8a055e155cb536fe3e1b.tar.gz emacs-0df76e3e71de3051c70f8a055e155cb536fe3e1b.zip | |
Make image-crop variables into user options
* lisp/image/image-crop.el (image-crop): New group.
(image-crop-crop-command, image-crop-resize-command)
(image-crop-elide-command, image-crop-crop-command): Make into
defcustoms.
Diffstat (limited to 'lisp/image')
| -rw-r--r-- | lisp/image/image-crop.el | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/lisp/image/image-crop.el b/lisp/image/image-crop.el index 2eadd0e1086..a88b8ed842e 100644 --- a/lisp/image/image-crop.el +++ b/lisp/image/image-crop.el | |||
| @@ -30,18 +30,24 @@ | |||
| 30 | (require 'svg) | 30 | (require 'svg) |
| 31 | (require 'text-property-search) | 31 | (require 'text-property-search) |
| 32 | 32 | ||
| 33 | (defgroup image-crop () | ||
| 34 | "Image cropping." | ||
| 35 | :group 'image) | ||
| 36 | |||
| 33 | (defvar image-crop-exif-rotate nil | 37 | (defvar image-crop-exif-rotate nil |
| 34 | "If non-nil, rotate images by updating exif data. | 38 | "If non-nil, rotate images by updating exif data. |
| 35 | If nil, rotate the images \"physically\".") | 39 | If nil, rotate the images \"physically\".") |
| 36 | 40 | ||
| 37 | (defvar image-crop-resize-command '("convert" "-resize" "%wx" "-" "%f:-") | 41 | (defcustom image-crop-resize-command '("convert" "-resize" "%wx" "-" "%f:-") |
| 38 | "Command to resize an image. | 42 | "Command to resize an image. |
| 39 | The following `format-spec' elements are allowed: | 43 | The following `format-spec' elements are allowed: |
| 40 | 44 | ||
| 41 | %w: Width. | 45 | %w: Width. |
| 42 | %f: Result file type.") | 46 | %f: Result file type." |
| 47 | :type '(repeat string) | ||
| 48 | :version "29.1") | ||
| 43 | 49 | ||
| 44 | (defvar image-crop-elide-command '("convert" "-draw" "rectangle %l,%t %r,%b" | 50 | (defcustom image-crop-elide-command '("convert" "-draw" "rectangle %l,%t %r,%b" |
| 45 | "-" "%f:-") | 51 | "-" "%f:-") |
| 46 | "Command to make a rectangle inside an image. | 52 | "Command to make a rectangle inside an image. |
| 47 | 53 | ||
| @@ -50,9 +56,11 @@ The following `format-spec' elements are allowed: | |||
| 50 | %t: Top. | 56 | %t: Top. |
| 51 | %r: Right. | 57 | %r: Right. |
| 52 | %b: Bottom. | 58 | %b: Bottom. |
| 53 | %f: Result file type.") | 59 | %f: Result file type." |
| 60 | :type '(repeat string) | ||
| 61 | :version "29.1") | ||
| 54 | 62 | ||
| 55 | (defvar image-crop-crop-command '("convert" "+repage" "-crop" "%wx%h+%l+%t" | 63 | (defcustom image-crop-crop-command '("convert" "+repage" "-crop" "%wx%h+%l+%t" |
| 56 | "-" "%f:-") | 64 | "-" "%f:-") |
| 57 | "Command to crop an image. | 65 | "Command to crop an image. |
| 58 | 66 | ||
| @@ -61,14 +69,18 @@ The following `format-spec' elements are allowed: | |||
| 61 | %t: Top. | 69 | %t: Top. |
| 62 | %w: Width. | 70 | %w: Width. |
| 63 | %h: Height. | 71 | %h: Height. |
| 64 | %f: Result file type.") | 72 | %f: Result file type." |
| 73 | :type '(repeat string) | ||
| 74 | :version "29.1") | ||
| 65 | 75 | ||
| 66 | (defvar image-crop-rotate-command '("convert" "-rotate" "%r" "-" "%f:-") | 76 | (defcustom image-crop-rotate-command '("convert" "-rotate" "%r" "-" "%f:-") |
| 67 | "Command to rotate an image. | 77 | "Command to rotate an image. |
| 68 | 78 | ||
| 69 | The following `format-spec' elements are allowed: | 79 | The following `format-spec' elements are allowed: |
| 70 | %r: Rotation (in degrees). | 80 | %r: Rotation (in degrees). |
| 71 | %f: Result file type.") | 81 | %f: Result file type." |
| 82 | :type '(repeat string) | ||
| 83 | :version "29.1") | ||
| 72 | 84 | ||
| 73 | (defvar image-crop-buffer-text-function #'image-crop--default-buffer-text | 85 | (defvar image-crop-buffer-text-function #'image-crop--default-buffer-text |
| 74 | "Function to return the buffer text for the cropped image. | 86 | "Function to return the buffer text for the cropped image. |