GNU bug report logs -
#69602
29.1; Image :map should adjust with :scale and :rotation
Previous Next
Full log
Message #53 received at 69602 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Joseph Turner <joseph <at> breatheoutbreathe.in>
>> Cc: 69602 <at> debbugs.gnu.org, stephen.berman <at> gmx.net, juri <at> linkov.net
>> Date: Fri, 22 Mar 2024 17:11:17 -0700
>>
>> > 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.
>
> Solves it here as well.
>
>> > . 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?
>
> I guess so. The transformations are AFAIK done in floating-point
> arithmetics, so some minor inaccuracies are possible.
>
>> In any case, I added `image-tests--map-equal' to compare image maps with
>> some tolerance. Do the tests pass on your machine now?
>
> Yes, they do now, thanks. However, there's a warning when compiling
> the tests:
>
> In image-tests--map-equal:
> lisp/image-tests.el:192:17: Warning: Unused lexical variable `i'
>
> Can you fix this, please?
Oops! I just re-read the dotimes docstring to discover that the RESULT
arg is deprecated. Fixed. Thank you!
Joseph
[0001-Recompute-map-when-image-scale-rotation-or-flip-chan.patch (text/x-diff, attachment)]
This bug report was last modified 1 year and 133 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.