diff options
| author | Alan Third | 2019-06-16 20:46:31 +0100 |
|---|---|---|
| committer | Alan Third | 2019-06-16 20:46:42 +0100 |
| commit | beb572a7ddc07760e077867e286790ddae30a12d (patch) | |
| tree | 9595b80194dcc0a8ea3bf9c999b8dbe6cca82ba9 /test | |
| parent | cf3081d208814ea02fce33aac645abfc24f880a6 (diff) | |
| download | emacs-beb572a7ddc07760e077867e286790ddae30a12d.tar.gz emacs-beb572a7ddc07760e077867e286790ddae30a12d.zip | |
Revert "Simplify image transforms"
This reverts commit cf3081d208814ea02fce33aac645abfc24f880a6.
; Pushed in error.
Diffstat (limited to 'test')
| -rw-r--r-- | test/manual/image-transforms-tests.el | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/test/manual/image-transforms-tests.el b/test/manual/image-transforms-tests.el index 907f0639e4c..d601b9397e3 100644 --- a/test/manual/image-transforms-tests.el +++ b/test/manual/image-transforms-tests.el | |||
| @@ -25,9 +25,6 @@ | |||
| 25 | 25 | ||
| 26 | ;; Type M-x test-transforms RET to generate the test buffer. | 26 | ;; Type M-x test-transforms RET to generate the test buffer. |
| 27 | 27 | ||
| 28 | ;; There is a difference in how librsvg and ImageMagick draw some of | ||
| 29 | ;; the images. This results in what looks like a one pixel difference. | ||
| 30 | |||
| 31 | ;;; Code: | 28 | ;;; Code: |
| 32 | 29 | ||
| 33 | (defun test-rotation () | 30 | (defun test-rotation () |
| @@ -47,6 +44,36 @@ | |||
| 47 | (insert-test "45" up up '(:rotation 45))) | 44 | (insert-test "45" up up '(:rotation 45))) |
| 48 | (insert "\n\n")) | 45 | (insert "\n\n")) |
| 49 | 46 | ||
| 47 | (defun test-cropping () | ||
| 48 | (let ((image "<svg height='30' width='30'> | ||
| 49 | <rect x='0' y='0' width='10' height='10'/> | ||
| 50 | <rect x='10' y='10' width='10' height='10' | ||
| 51 | style='fill:none;stroke-width:1;stroke:#000'/> | ||
| 52 | <line x1='10' y1='10' x2='20' y2='20' style='stroke:#000'/> | ||
| 53 | <line x1='20' y1='10' x2='10' y2='20' style='stroke:#000'/> | ||
| 54 | <rect x='20' y='20' width='10' height='10' | ||
| 55 | style='fill:none;stroke-width:1;stroke:#000'/> | ||
| 56 | </svg>") | ||
| 57 | (top-left "<svg height='10' width='10'> | ||
| 58 | <rect x='0' y='0' width='10' height='10'/> | ||
| 59 | </svg>") | ||
| 60 | (middle "<svg height='10' width='10'> | ||
| 61 | <rect x='0' y='0' width='10' height='10' | ||
| 62 | style='fill:none;stroke-width:1;stroke:#000'/> | ||
| 63 | <line x1='0' y1='0' x2='10' y2='10' style='stroke:#000'/> | ||
| 64 | <line x1='10' y1='0' x2='0' y2='10' style='stroke:#000'/> | ||
| 65 | </svg>") | ||
| 66 | (bottom-right "<svg height='10' width='10'> | ||
| 67 | <rect x='0' y='0' width='10' height='10' | ||
| 68 | style='fill:none;stroke-width:1;stroke:#000'/> | ||
| 69 | </svg>")) | ||
| 70 | (insert-header "Test Crop: cropping an image") | ||
| 71 | (insert-test "all params" top-left image '(:crop (10 10 0 0))) | ||
| 72 | (insert-test "width/height only" middle image '(:crop (10 10))) | ||
| 73 | (insert-test "negative x y" middle image '(:crop (10 10 -10 -10))) | ||
| 74 | (insert-test "all params" bottom-right image '(:crop (10 10 20 20)))) | ||
| 75 | (insert "\n\n")) | ||
| 76 | |||
| 50 | (defun test-scaling () | 77 | (defun test-scaling () |
| 51 | (let ((image "<svg height='10' width='10'> | 78 | (let ((image "<svg height='10' width='10'> |
| 52 | <rect x='0' y='0' width='10' height='10' | 79 | <rect x='0' y='0' width='10' height='10' |
| @@ -143,6 +170,7 @@ | |||
| 143 | (unless #'imagemagick-types | 170 | (unless #'imagemagick-types |
| 144 | (insert "ImageMagick not detected. ImageMagick tests will be skipped.\n\n")) | 171 | (insert "ImageMagick not detected. ImageMagick tests will be skipped.\n\n")) |
| 145 | (test-rotation) | 172 | (test-rotation) |
| 173 | (test-cropping) | ||
| 146 | (test-scaling) | 174 | (test-scaling) |
| 147 | (test-scaling-rotation) | 175 | (test-scaling-rotation) |
| 148 | (goto-char (point-min)))) | 176 | (goto-char (point-min)))) |