bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#69602: 29.1; Image :map should adjust with :scale and :rotation


From: Joseph Turner
Subject: bug#69602: 29.1; Image :map should adjust with :scale and :rotation
Date: Sat, 23 Mar 2024 10:41:59 -0700

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Cc: 69602@debbugs.gnu.org, stephen.berman@gmx.net, juri@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

Attachment: 0001-Recompute-map-when-image-scale-rotation-or-flip-chan.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]