From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69602: 29.1; Image :map should adjust with :scale and :rotation Date: Sat, 23 Mar 2024 09:58:51 +0200 Message-ID: <86cyrlz8ec.fsf@gnu.org> References: <87msramv72.fsf@breatheoutbreathe.in> <86jzmejzfd.fsf@gnu.org> <87a5namqyz.fsf@breatheoutbreathe.in> <86cys63281.fsf@gnu.org> <87wmqelakx.fsf@breatheoutbreathe.in> <86bk7q2xye.fsf@gnu.org> <871q8lk2o7.fsf@breatheoutbreathe.in> <87o7bpi4c1.fsf@breatheoutbreathe.in> <867cid15wv.fsf@gnu.org> <87bk7phzdz.fsf@breatheoutbreathe.in> <8634t10woh.fsf@gnu.org> <87il1g5b8m.fsf@breatheoutbreathe.in> <86y1ab23sw.fsf@gnu.org> <877cht94sb.fsf@breatheoutbreathe.in> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28349"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69602@debbugs.gnu.org, stephen.berman@gmx.net, juri@linkov.net To: Joseph Turner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 23 09:21:45 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rnwdM-0007Cg-HM for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Mar 2024 09:21:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rnwd1-0000Oq-6U; Sat, 23 Mar 2024 04:21:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rnwcz-0000Of-AX for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2024 04:21:21 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rnwcz-0002oY-2m for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2024 04:21:21 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rnwdd-000574-Tc for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2024 04:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Mar 2024 08:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69602 X-GNU-PR-Package: emacs Original-Received: via spool by 69602-submit@debbugs.gnu.org id=B69602.171118209519561 (code B ref 69602); Sat, 23 Mar 2024 08:22:01 +0000 Original-Received: (at 69602) by debbugs.gnu.org; 23 Mar 2024 08:21:35 +0000 Original-Received: from localhost ([127.0.0.1]:35793 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnwdD-00055L-9w for submit@debbugs.gnu.org; Sat, 23 Mar 2024 04:21:35 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35804) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnwdB-00054x-GM for 69602@debbugs.gnu.org; Sat, 23 Mar 2024 04:21:34 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rnwHE-0007aN-AU; Sat, 23 Mar 2024 03:58:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=a4hEaDMNeTGKXSwySZp37/uRgjOLcnXm/N0IyuhrJHA=; b=BQIfVqblyvCgJAbKvARw lY25x1UnplBTeu3fXVIUJ59igdN8La73spQyp2ESbypFAvjy14oSyN30tZM3kzUwwv/gkGngZI30F K2FGcJ+CJ3ybzaEBts6zbXqsruKJOjXEZMKRykFKHQBiQ92M0j/5KVacR3s15n01/LRlCtEAbwmXZ rZQ5c8pCMrrRVIbBDxOMfJJXXXVHl5jmnr3a2O3bdSftbCZPT7ec+FwduxnTBSZWZYbRnLGNTDnLw pZZbtIExluIMMwtlpA55i6cv3g21sM/xKoep4wyDD6shIkjt2Ezwngcb/svr9EGjPQlIBhzOm9Y0L GCCsOyPaH1uFOg==; In-Reply-To: <877cht94sb.fsf@breatheoutbreathe.in> (message from Joseph Turner on Fri, 22 Mar 2024 17:11:17 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:281974 Archived-At: > From: Joseph Turner > 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?