Eli Zaretskii writes: >> From: Joseph Turner >> Cc: 69602@debbugs.gnu.org, stephen.berman@gmx.net, juri@linkov.net >> Date: Wed, 20 Mar 2024 23:45:34 -0700 >> >> > I had in mind a special variable (we'd need to mention it in NEWS and >> > in the doc string of the relevant functions). Adding an argument is a >> > heavier change, and I think it is not justified in this case, because >> > I do agree with you that most, if not all, applications would want the >> > coordinates to scale together with the image. >> >> Thanks for your feedback and your patience! >> >> Please see attached patch. > > Thanks. The tests you added have some problems: > > . you use thread-first, but don't require subr-x when compiling I removed thread-first. > . the tests fail when run in batch mode I added (skip-unless (display-images-p)) to the two problematic tests, and it solved the issue on my machine. > . when invoked interactively in a GUI session, one test fails: > > F image--compute-map-and-original-map > Test ‘image--compute-map’ and ‘image--compute-original-map’. > (ert-test-failed > ((should (equal (image--compute-map image) flipped-map)) :form > (equal > (((circle ... . 24) "a" (help-echo "A")) > ((rect ... 162 . 149) "b" (help-echo "B")) > ((poly . [6 29 7 22 13 15 21 10 31 7 ...]) "c" (help-echo "C"))) > (((circle ... . 24) "a" (help-echo "A")) > ((rect ... 161 . 149) "b" (help-echo "B")) > ((poly . [5 29 6 22 12 15 20 10 30 7 ...]) "c" (help-echo "C")))) > :value nil :explanation (list-elt 0 (list-elt 0 (cdr (car ...)))))) > > It looks like some pixels do not match exactly? Perhaps some > tolerances need to be allowed? Interesting - does the result of `image-size` vary per machine? In any case, I added `image-tests--map-equal' to compare image maps with some tolerance. Do the tests pass on your machine now? Thank you! Joseph