From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70093: *** SPAM *** bug#70093: Remove unnecessary `image-tests--map-equal' Date: Fri, 05 Apr 2024 18:50:12 -0700 Message-ID: <87o7ans1en.fsf@breatheoutbreathe.in> References: <877chjcxfg.fsf@breatheoutbreathe.in> <1d1367e3-d888-4a00-8204-1bb6c3607801@orange.fr> <87frw6c0dv.fsf@breatheoutbreathe.in> <3d281f2a-9871-4345-9fb0-3c918943affe@orange.fr> Reply-To: Joseph Turner Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15162"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70093@debbugs.gnu.org, Eli Zaretskii To: David Ponce Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 06 03:53:20 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 1rsvFA-0003e7-2H for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Apr 2024 03:53:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rsvEn-00005l-N0; Fri, 05 Apr 2024 21:52:57 -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 1rsvEm-0008WV-HH for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 21:52:56 -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 1rsvEm-0008QQ-5a for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 21:52:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rsvEr-00045l-OP for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 21:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Joseph Turner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Apr 2024 01:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70093 X-GNU-PR-Package: emacs Original-Received: via spool by 70093-submit@debbugs.gnu.org id=B70093.171236837315709 (code B ref 70093); Sat, 06 Apr 2024 01:53:01 +0000 Original-Received: (at 70093) by debbugs.gnu.org; 6 Apr 2024 01:52:53 +0000 Original-Received: from localhost ([127.0.0.1]:37866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsvEi-00045J-KE for submit@debbugs.gnu.org; Fri, 05 Apr 2024 21:52:53 -0400 Original-Received: from out-186.mta0.migadu.com ([91.218.175.186]:58455) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsvEe-00044N-Mk for 70093@debbugs.gnu.org; Fri, 05 Apr 2024 21:52:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1712368356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8Yy27qdGhuCXKmBVd7EsgSdxmaSA9I4nC6yw7a69OU0=; b=XMO1lqpZPWk163pi0ivTK+b1ECByr/yElhq/dXSso5Sob7779T3Z9ATVdktHq+VmqAcHJ9 kCCJydk+NVxSG6/VVfcxUqjSr3NyNZnbn8RHlASxKp4J+sETT2p0+f1pHaCDFALa7yq0E7 k12/b6tgJBzMjNnCQVLh6gLM75uJxf4= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: <3d281f2a-9871-4345-9fb0-3c918943affe@orange.fr> X-Migadu-Flow: FLOW_OUT 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:282734 Archived-At: David Ponce writes: > [...]> But these 2 tests fails: >> 1. >> =C2=A0=C2=A0=C2=A0 (setf (image-property image :scale) 1) >> =C2=A0=C2=A0=C2=A0 (setf (image-property image :rotation) 90) >> =C2=A0=C2=A0=C2=A0 (should (equal (image--compute-map image) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rotated-= map)) >> =C2=A0=C2=A0=C2=A0 ;; Return >> =C2=A0=C2=A0=C2=A0 ((((circle (199 . 41) . 24) "a" (help-echo "A")) >> =C2=A0=C2=A0=C2=A0=C2=A0 ((rect (79 . 5) 127 . 77) "b" (help-echo "B")) >> =C2=A0=C2=A0=C2=A0=C2=A0 ((poly . [199 161 206 160 213 154 218 146 221 = 136 223 125 221 >> 114 218 104 213 96 206 91 199 89 191 91 185 96 179 104 176 114 175 >> 125 176 136 179 146 185 154 191 160]) "c" (help-echo "C"))) >> =C2=A0=C2=A0=C2=A0 ;; Instead of >> =C2=A0=C2=A0=C2=A0 (((circle (126 . 41) . 24) "a" (help-echo "A")) >> =C2=A0=C2=A0=C2=A0=C2=A0 ((rect (6 . 5) 54 . 77) "b" (help-echo "B")) >> =C2=A0=C2=A0=C2=A0=C2=A0 ((poly . [126 161 133 160 140 154 145 146 148 = 136 150 125 148 >> 114 145 104 140 96 133 91 126 89 118 91 112 96 106 104 103 114 102 >> 125 103 136 106 146 112 154 118 160]) "c" (help-echo "C")))) >> =C2=A0=C2=A0=C2=A0 ;; All the result X coords are different, but Y coor= ds are expected. >> 2. >> =C2=A0=C2=A0=C2=A0 (setf (image-property image :rotation) 0) >> =C2=A0=C2=A0=C2=A0 (setf (image-property image :flip) t) >> =C2=A0=C2=A0=C2=A0 (should (equal (image--compute-map image) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 flipped-= map)) >> =C2=A0=C2=A0=C2=A0 ;; Return >> =C2=A0=C2=A0=C2=A0 ((((circle (205 . 29) . 24) "a" (help-echo "A")) >> =C2=A0=C2=A0=C2=A0=C2=A0 ((rect (169 . 101) 241 . 149) "b" (help-echo "= B")) >> =C2=A0=C2=A0=C2=A0=C2=A0 ((poly . [85 29 86 22 92 15 100 10 110 7 121 5= 132 7 142 10 >> 150 15 155 22 157 29 155 37 150 43 142 49 132 52 121 53 110 52 100 >> 49 92 43 86 37]) "c" (help-echo "C"))) >> =C2=A0=C2=A0=C2=A0 ;; Instead of >> =C2=A0=C2=A0=C2=A0 (((circle (125 . 29) . 24) "a" (help-echo "A")) >> =C2=A0=C2=A0=C2=A0=C2=A0 ((rect (89 . 101) 161 . 149) "b" (help-echo "B= ")) >> =C2=A0=C2=A0=C2=A0=C2=A0 ((poly . [5 29 6 22 12 15 20 10 30 7 41 5 52 7= 62 10 70 15 75 >> 22 77 29 75 37 70 43 62 49 52 52 41 53 30 52 20 49 12 43 6 37]) "c" >> (help-echo "C")))) >> =C2=A0=C2=A0=C2=A0 ;; All the result X coords are different, but Y coor= ds are expected. >> On my laptop: >> =C2=A0 (image-size (image--image-without-parameters image) t) =3D> (228= . >> 246) >> Hope it will help to understand the reason. > [...] > > Hello, > > I am still trying to understand why the 2 tests above fails with my confi= guration. > From the test `image--compute-map-and-original-map' I wrote the below equ= ivalent > code to be evaled in the *scratch* buffer, in order to observe and analyz= e the > results interactively. The shapes are derived from the hot spots coordin= ates to > ensure a strict visual correspondance between a shape and its hot spot. > > On my configuration, all the computed map from the different image variat= ions are > correct. You can test it by hovering the different produced colored shap= es with > the mouse, and observe the mouse pointer and help-echo changes. > > My conclusion at this point is that the values of `flipped-map' and `rota= ted-map' > are not correct for my configuration, but I don't know why. > > If you can try the below code and observe the result on your configuratio= n, maybe > could we get a better understanding of what is happening for the 2 tests = that fail? > > Thanks! > > _________________________________________________________________________= _____ > > (let* ((svg (svg-create "125pt" "116pt")) ;; 246px X 228px on my conf. > (original-map > '(((circle (41 . 29) . 24) "a" (help-echo "A")) > ((rect (5 . 101) 77 . 149) "b" (help-echo "B")) > ((poly . [ 161 29 160 22 154 15 146 10 136 7 125 5 114 7 > 104 10 96 15 91 22 89 29 91 37 96 43 104 49 > 114 52 125 53 136 52 146 49 154 43 160 37]) > "c" (help-echo "C")))) > (scaled-map > '(((circle (82 . 58) . 48) "a" (help-echo "A")) > ((rect (10 . 202) 154 . 298) "b" (help-echo "B")) > ((poly . [ 322 58 320 44 308 30 292 20 272 14 250 10 228 14 > 208 20 192 30 182 44 178 58 182 74 192 86 208 98 > 228 104 250 106 272 104 292 98 308 86 320 74]) > "c" (help-echo "C")))) > (flipped-map > '(((circle (125 . 29) . 24) "a" (help-echo "A")) > ((rect (89 . 101) 161 . 149) "b" (help-echo "B")) > ((poly . [ 5 29 6 22 12 15 20 10 30 7 41 5 52 7 62 10 70 15 > 75 22 77 29 75 37 70 43 62 49 52 52 41 53 30 52 > 20 49 12 43 6 37]) > "c" (help-echo "C")))) > (rotated-map > '(((circle (126 . 41) . 24) "a" (help-echo "A")) > ((rect (6 . 5) 54 . 77) "b" (help-echo "B")) > ((poly . [ 126 161 133 160 140 154 145 146 148 136 150 125 > 148 114 145 104 140 96 133 91 126 89 118 91 > 112 96 106 104 103 114 102 125 103 136 106 146 > 112 154 118 160]) > "c" (help-echo "C")))) > (scaled-rotated-flipped-map > '(((circle (58 . 82) . 48) "a" (help-echo "A")) > ((rect (202 . 10) 298 . 154) "b" (help-echo "B")) > ((poly . [ 58 322 44 320 30 308 20 292 14 272 10 250 14 228 > 20 208 30 192 44 182 58 178 74 182 86 192 98 208 > 104 228 106 250 104 272 98 292 86 308 74 320]) > "c" (help-echo "C")))) > ) > (svg-rectangle svg 5 101 (- 77 5) (- 149 101) > :stroke-width 0 :fill "red") > (svg-circle svg 41 29 24 > :stroke-width 0 :fill "green") > (svg-polyline svg '((161 . 29) (160 . 22) (154 . 15) (146 . 10) > (136 . 7) (125 . 5) (114 . 7) (104 . 10) > (96 . 15) (91 . 22) (89 . 29) (91 . 37) > (96 . 43) (104 . 49) (114 . 52) (125 . 53) > (136 . 52) (146 . 49) (154 . 43) (160 . 37)) > :stroke-width 0 :fill "blue") > (let ((image (svg-image svg :map scaled-rotated-flipped-map > :scale 2 :rotation 90 :flip t))) > ;; Test that `image--compute-original-map' correctly generates > ;; original-map when creating an already transformed image. > (insert > (format > "\n:flip %s :rotation %s :scale %s (equal :original-map original-ma= p)=3D>%s" > (image-property image :flip) > (image-property image :rotation) > (image-property image :scale) > (equal (image-property image :original-map) > original-map))) > (print image) > (insert-image image) > (setf (image-property image :flip) nil) > (setf (image-property image :rotation) 0) > (setf (image-property image :scale) 2) > (let ((map (image--compute-map image))) > (insert > (format > "\n:flip %s :rotation %s :scale %s (equal map scaled-map)=3D>%s" > (image-property image :flip) > (image-property image :rotation) > (image-property image :scale) > (equal map scaled-map))) > (setf (image-property image :map) map) > (print image) > ;; insert a new image in current buffer. > (insert-image (copy-tree image t)) > ) > > (setf (image-property image :scale) 1) > (setf (image-property image :rotation) 90) > (let ((map (image--compute-map image))) > (insert > (format > "\n:flip %s :rotation %s :scale %s (equal map rotated-map)=3D>%s" > (image-property image :flip) > (image-property image :rotation) > (image-property image :scale) > (equal map rotated-map))) > (setf (image-property image :map) map) > (print image) > ;; insert a new image in current buffer. > (insert-image (copy-tree image t)) > ) > > (setf (image-property image :rotation) 0) > (setf (image-property image :flip) t) > (let ((map (image--compute-map image))) > (insert > (format > "\n:flip %s :rotation %s :scale %s (equal map flipped-map)=3D>%s" > (image-property image :flip) > (image-property image :rotation) > (image-property image :scale) > (equal map flipped-map))) > (setf (image-property image :map) map) > (print image) > ;; insert a new image in current buffer. > (insert-image (copy-tree image t)) > ) > > (setf (image-property image :scale) 2) > (setf (image-property image :rotation) 90) > (let ((map (image--compute-map image))) > (insert > (format > "\n:flip %s :rotation %s :scale %s (equal map scaled-rotated-flip= ped-map)=3D>%s" > (image-property image :flip) > (image-property image :rotation) > (image-property image :scale) > (equal map scaled-rotated-flipped-map))) > (setf (image-property image :map) map) > (print image) > ;; insert a new image in current buffer. > (insert-image (copy-tree image t)) > ) > )) When I evaluate this block and hover over the various shapes, the help-echo pop-ups appear at the correct boundaries. Are you able to reproduce this issue with my patch with emacs -Q? Without the patch? Thank you! Joseph