GNU bug report logs - #70093
Remove unnecessary `image-tests--map-equal'

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Joseph Turner <joseph@HIDDEN>; dated Sat, 30 Mar 2024 19:50:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 70093 <at> debbugs.gnu.org:


Received: (at 70093) by debbugs.gnu.org; 6 Apr 2024 01:52:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 05 21:52:53 2024
Received: from localhost ([127.0.0.1]:37866 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rsvEi-00045J-KE
	for submit <at> debbugs.gnu.org; Fri, 05 Apr 2024 21:52:53 -0400
Received: from out-186.mta0.migadu.com ([91.218.175.186]:58455)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joseph@HIDDEN>) id 1rsvEe-00044N-Mk
 for 70093 <at> debbugs.gnu.org; Fri, 05 Apr 2024 21:52:50 -0400
References: <877chjcxfg.fsf@HIDDEN>
 <1d1367e3-d888-4a00-8204-1bb6c3607801@HIDDEN>
 <87frw6c0dv.fsf@HIDDEN>
 <d2e50c9a-c137-4c71-bc53-3fa2885ab37d@HIDDEN>
 <3d281f2a-9871-4345-9fb0-3c918943affe@HIDDEN>
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@HIDDEN and
 include these headers.
From: Joseph Turner <joseph@HIDDEN>
To: David Ponce <da_vid@HIDDEN>
Subject: Re: *** SPAM *** bug#70093: Remove unnecessary
 `image-tests--map-equal'
Date: Fri, 05 Apr 2024 18:50:12 -0700
In-reply-to: <3d281f2a-9871-4345-9fb0-3c918943affe@HIDDEN>
Message-ID: <87o7ans1en.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70093
Cc: 70093 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


David Ponce <da_vid@HIDDEN> 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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70093; Package emacs. Full text available.

Message received at 70093 <at> debbugs.gnu.org:


Received: (at 70093) by debbugs.gnu.org; 2 Apr 2024 10:36:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 02 06:36:45 2024
Received: from localhost ([127.0.0.1]:52640 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rrbVU-0001a4-N7
	for submit <at> debbugs.gnu.org; Tue, 02 Apr 2024 06:36:45 -0400
Received: from smtp-26.smtpout.orange.fr ([80.12.242.26]:49212
 helo=smtp.smtpout.orange.fr)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <da_vid@HIDDEN>) id 1rrbVN-0001ZO-C7
 for 70093 <at> debbugs.gnu.org; Tue, 02 Apr 2024 06:36:42 -0400
Received: from [192.168.1.15] ([2.7.71.181]) by smtp.orange.fr with ESMTPA
 id rbVHrDvLBD2ZqrbVHrSzS0; Tue, 02 Apr 2024 12:36:32 +0200
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.fr;
 s=t20230301; t=1712054192;
 bh=3NXzxYM6/YwDToCrOWGOKJdsxKNsDdjIZkbCMwzkyJQ=;
 h=Message-ID:Date:MIME-Version:Subject:From:To;
 b=TO935Iq6qKoDKFt5vo0xW8gBfiCMk6DFb4qT1n/7lmFQ+KTiACfrPk6dPsOJbyK5X
 j/SJ5zdaYhKk0RkRM+du/FpSpC1+fixbKmU80SCyTt9NhTB5MRJGUEV5JpK2xNh0Ps
 fcJQUgTFEKSIuejPQEeyhYzUlmMivjLIYAaH/xges3p+cvDUBrc3X2tLucBL7yYElv
 E+FxrChBO6yjq2I5b6ShZiNIyVL8JKy6vA47vTDhf2ETxup+opdHgeL8Ja+cvnKJH6
 Bh6m1/pdnSRzQSxbibBTD4mzwjUUBevSB8/t3qWqnanYNhd9CGZuhjO8vGLIdMSfcF
 1KyZZMvr8qEnw==
X-ME-Helo: [192.168.1.15]
X-ME-Auth: ZGFfdmlkQHdhbmFkb28uZnI=
X-ME-Date: Tue, 02 Apr 2024 12:36:32 +0200
X-ME-IP: 2.7.71.181
Message-ID: <3d281f2a-9871-4345-9fb0-3c918943affe@HIDDEN>
Date: Tue, 2 Apr 2024 12:36:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: *** SPAM *** bug#70093: Remove unnecessary
 `image-tests--map-equal'
From: David Ponce <da_vid@HIDDEN>
To: Joseph Turner <joseph@HIDDEN>
References: <877chjcxfg.fsf@HIDDEN>
 <1d1367e3-d888-4a00-8204-1bb6c3607801@HIDDEN>
 <87frw6c0dv.fsf@HIDDEN>
 <d2e50c9a-c137-4c71-bc53-3fa2885ab37d@HIDDEN>
Content-Language: fr, en-US
In-Reply-To: <d2e50c9a-c137-4c71-bc53-3fa2885ab37d@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: 1.9 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  [...]> But these 2 tests fails: > > 1. >     (setf (image-property
    image :scale) 1) >     (setf (image-property image :rotation) 90) >    
    (should (equal (image--compute-map image) >      [...] 
 
 Content analysis details:   (1.9 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [80.12.242.26 listed in wl.mailspike.net]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [80.12.242.26 listed in list.dnswl.org]
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (da_vid[at]orange.fr)
  0.0 T_SPF_TEMPERROR        SPF: test of record failed (temperror)
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
  1.9 FORGED_SPF_HELO        No description available.
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
X-Debbugs-Envelope-To: 70093
Cc: 70093 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

[...]> But these 2 tests fails:
> 
> 1.
>      (setf (image-property image :scale) 1)
>      (setf (image-property image :rotation) 90)
>      (should (equal (image--compute-map image)
>                                      rotated-map))
> 
>      ;; Return
>      ((((circle (199 . 41) . 24) "a" (help-echo "A"))
>       ((rect (79 . 5) 127 . 77) "b" (help-echo "B"))
>       ((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")))
>      ;; Instead of
>      (((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"))))
>      ;; All the result X coords are different, but Y coords are expected.
> 
> 2.
>      (setf (image-property image :rotation) 0)
>      (setf (image-property image :flip) t)
>      (should (equal (image--compute-map image)
>                                      flipped-map))
> 
>      ;; Return
>      ((((circle (205 . 29) . 24) "a" (help-echo "A"))
>       ((rect (169 . 101) 241 . 149) "b" (help-echo "B"))
>       ((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")))
>      ;; Instead of
>      (((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"))))
>      ;; All the result X coords are different, but Y coords are expected.
> 
> On my laptop:
> 
>    (image-size (image--image-without-parameters image) t) => (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 configuration.
 From the test `image--compute-map-and-original-map' I wrote the below equivalent
code to be evaled in the *scratch* buffer, in order to observe and analyze the
results interactively.  The shapes are derived from the hot spots coordinates to
ensure a strict visual correspondance between a shape and its hot spot.

On my configuration, all the computed map from the different image variations are
correct.  You can test it by hovering the different produced colored shapes 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 `rotated-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 configuration, 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-map)=>%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)=>%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)=>%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)=>%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-flipped-map)=>%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))
       )
     ))





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70093; Package emacs. Full text available.

Message received at 70093 <at> debbugs.gnu.org:


Received: (at 70093) by debbugs.gnu.org; 31 Mar 2024 10:08:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 31 06:08:36 2024
Received: from localhost ([127.0.0.1]:46664 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rqs79-0001yQ-UL
	for submit <at> debbugs.gnu.org; Sun, 31 Mar 2024 06:08:36 -0400
Received: from smtp-73.smtpout.orange.fr ([80.12.242.73]:65454
 helo=msa.smtpout.orange.fr)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <da_vid@HIDDEN>) id 1rqs77-0001yG-0Z
 for 70093 <at> debbugs.gnu.org; Sun, 31 Mar 2024 06:08:35 -0400
Received: from [192.168.1.15] ([2.7.71.181]) by smtp.orange.fr with ESMTPA
 id qs71r56PMp1yHqs72rAAP4; Sun, 31 Mar 2024 12:08:29 +0200
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.fr;
 s=t20230301; t=1711879709;
 bh=efWXWhybYc8tP+pxAlQZrxfAq3jzHo84wVDxFkJTFIc=;
 h=Message-ID:Date:MIME-Version:Subject:To:From;
 b=HZc1VmN209JoC67RFLcmHIpiv6mJ0OFE7SXmd3tkN6W2hhaGVqN1Kxl5Xi1rmPQaO
 EnnWImBaCURelacqLQZADYms4qDmI0UVev9K7We98h3YTl2qyJ4QDCclND8BidvGJq
 nOn/1DIOBBgxirOjQE6XM0aHW6x4JauWiAULHK+gXClJdykL/fHicc0rbaPHahggc8
 khBNx8dTlyrqL8yvMPc4c/ZvjU12Mx5TOCiiPa6nCZrSDWQLagxvquAlSwiEOECPUN
 6LcDs4QkTJuGR2QUJ2HyeMbHD8e6Rh3Hz7776uWkH//wiHpsIKoxYrY4seivTzO4/p
 XEuWUw5pc5nig==
X-ME-Helo: [192.168.1.15]
X-ME-Auth: ZGFfdmlkQHdhbmFkb28uZnI=
X-ME-Date: Sun, 31 Mar 2024 12:08:29 +0200
X-ME-IP: 2.7.71.181
Message-ID: <d2e50c9a-c137-4c71-bc53-3fa2885ab37d@HIDDEN>
Date: Sun, 31 Mar 2024 12:08:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: *** SPAM *** bug#70093: Remove unnecessary
 `image-tests--map-equal'
To: Joseph Turner <joseph@HIDDEN>
References: <877chjcxfg.fsf@HIDDEN>
 <1d1367e3-d888-4a00-8204-1bb6c3607801@HIDDEN>
 <87frw6c0dv.fsf@HIDDEN>
Content-Language: fr, en-US
From: David Ponce <da_vid@HIDDEN>
In-Reply-To: <87frw6c0dv.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 70093
Cc: 70093 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 31/03/2024 09:37, Joseph Turner wrote:
> 
> David Ponce <da_vid@HIDDEN> writes:
> 
>> On 30/03/2024 20:44, Joseph Turner wrote:
>>> With the resolution of bug#69992, it may be possible to remove the
>>> `image-tests--map-equal' equality predicate from lisp/image-tests.el.
>>> Eli and David, would you please apply the attached patch and then
>>> run
>>> the tests to see if we still need to allow for tolerances in
>>> `image--compute-map-and-original-map'?
>>> The tests pass for me, but then again, they never failed on my
>>> machine...
>>> Thank you!! I'm grateful for this fun collaboration. :)
>>> Joseph
>>>
>>
>> Hi Joseph,
>>
>> Did you forget to attach the patch? I cannot find it.
> 
> Apologies.  Here it is.  (This is the same patch as in my response to Eli)
> 
>> Anyway, I don't think the resolution of bug#69992 changed anything
>> regarding the test `image--compute-map-and-original-map'.  And to
>> be honest I don't understand why it gives a different result on our
>> configurations.
> 
> I thought perhaps calculating scale with
> 
> (/ (float (car size))
>                       (car (image-size
>                             (image--image-without-parameters image) t)))
> 
> instead of
> 
> (or (image-property image :scale) 1)
> 
> would fix the variations on our machines.
> 
>> To test, I also eval the following simple code in *scratch* buffer,
>> which gives me consistent results on my laptop:
>>
>> (let* ((svg (svg-create 200 100))
>>         (omap `(((rect . ((0 . 0) . (50 . 50)))
>>                  rect-test (help-echo "rect-test"))
>>                 ((circle . ((85 . 55) . 25))
>>                  circle-test (help-echo "circle-test"))
>>                 ((poly . [100 0 125 0 170 50 125 50])
>>                  poly-test (help-echo "poly-test")))))
>>    (svg-rectangle svg 0 0 50 50
>>                   :stroke-width 0 :fill "red")
>>    (svg-circle    svg 85 55 25
>>                   :stroke-width 0 :fill "green")
>>    (svg-polyline  svg '((100 . 0) (125 . 0) (170 . 50) (125 . 50))
>>                   :stroke-width 0 :fill "blue")
>>    (let ((image (svg-image svg
>>                            :original-map omap
>>                            :scale nil    ;; vary scale test
>>                            :rotation nil ;; vary rotation test
>>                            :flip nil     ;; vary flip test
>>                            )))
>>      ;; Must see the pointer and help-echo change when mouse hovers the
>>      ;; rect, circle and poly hot spots.
>>      (insert-image image)
>>      (insert ?\n)
>>      ;; Must see the same original map.
>>      (image--compute-original-map image)))
> 
> This manual test also works on my machine.  I had been doing something
> similar; I like your use of svg-create :)
> 
> Let me know if the unit tests pass with this patch applied.
> 
> Thank you!
> 
> Joseph
> 
Hello,

With the patch applied the test fails the same for me:

_______________________________________________________________
Selector: image--compute-map-and-original-map
Passed:  0
Failed:  1 (1 unexpected)
Skipped: 0
Total:   1/1

Started at:   2024-03-31 11:17:56+0200
Finished.
Finished at:  2024-03-31 11:17:56+0200

F

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) rotated-map)) :form
       (equal
        (((circle ... . 24) "a" (help-echo "A"))
         ((rect ... 127 . 77) "b" (help-echo "B"))
         ((poly . [199 161 206 160 213 154 218 146 221 136 ...]) "c"
          (help-echo "C")))
        (((circle ... . 24) "a" (help-echo "A"))
         ((rect ... 54 . 77) "b" (help-echo "B"))
         ((poly . [126 161 133 160 140 154 145 146 148 136 ...]) "c"
          (help-echo "C"))))
       :value nil :explanation (list-elt 0 (list-elt 0 (cdr (car ...))))))
_______________________________________________________________

More in detail, these 3 tests pass:

1.
     (should (equal (image-property image :original-map)
                                     original-map))
2.
     (setf (image-property image :flip) nil)
     (setf (image-property image :rotation) 0)
     (setf (image-property image :scale) 2)
     (should (equal (image--compute-map image)
                                     scaled-map))
3.
     (setf (image-property image :scale) 2)
     (setf (image-property image :rotation) 90)
     (should (equal (image--compute-map image)
                                     scaled-rotated-flipped-map))

But these 2 tests fails:

1.
     (setf (image-property image :scale) 1)
     (setf (image-property image :rotation) 90)
     (should (equal (image--compute-map image)
                                     rotated-map))

     ;; Return
     ((((circle (199 . 41) . 24) "a" (help-echo "A"))
      ((rect (79 . 5) 127 . 77) "b" (help-echo "B"))
      ((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")))
     ;; Instead of
     (((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"))))
     ;; All the result X coords are different, but Y coords are expected.

2.
     (setf (image-property image :rotation) 0)
     (setf (image-property image :flip) t)
     (should (equal (image--compute-map image)
                                     flipped-map))

     ;; Return
     ((((circle (205 . 29) . 24) "a" (help-echo "A"))
      ((rect (169 . 101) 241 . 149) "b" (help-echo "B"))
      ((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")))
     ;; Instead of
     (((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"))))
     ;; All the result X coords are different, but Y coords are expected.

On my laptop:

   (image-size (image--image-without-parameters image) t) => (228 . 246)

Hope it will help to understand the reason.

Thanks!






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70093; Package emacs. Full text available.

Message received at 70093 <at> debbugs.gnu.org:


Received: (at 70093) by debbugs.gnu.org; 31 Mar 2024 07:43:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 31 03:43:26 2024
Received: from localhost ([127.0.0.1]:46517 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rqpqf-00077u-Ou
	for submit <at> debbugs.gnu.org; Sun, 31 Mar 2024 03:43:26 -0400
Received: from out-172.mta0.migadu.com ([2001:41d0:1004:224b::ac]:24362)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joseph@HIDDEN>) id 1rqpqc-00077V-Dy
 for 70093 <at> debbugs.gnu.org; Sun, 31 Mar 2024 03:43:24 -0400
References: <877chjcxfg.fsf@HIDDEN>
 <1d1367e3-d888-4a00-8204-1bb6c3607801@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; 
 s=key1; t=1711870993;
 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:
 in-reply-to:in-reply-to:references:references;
 bh=ByxuCFvSH8mD1rLPQ/cp89Oivot8UAnAoILuhEZvGi0=;
 b=Dg8FlmEd8F2hwpcNSp93Yd0FdfaFiGk8zqriJbFhtkL1Okmf1mjmdkXAnWjBTTTnXZSLJ7
 E1R7ZvEtlgmdNEoUo+mYrdqM75+yD6qZLq5/9M33+RJnd91rLUYT8ldoU72Jm1cAOCa5RI
 mFYKa5qkmE6blKRa84p2EoVj0HAlCP8=
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
From: Joseph Turner <joseph@HIDDEN>
To: David Ponce <da_vid@HIDDEN>
Subject: Re: *** SPAM *** bug#70093: Remove unnecessary
 `image-tests--map-equal'
Date: Sun, 31 Mar 2024 00:37:35 -0700
In-reply-to: <1d1367e3-d888-4a00-8204-1bb6c3607801@HIDDEN>
Message-ID: <87frw6c0dv.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70093
Cc: 70093 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain


David Ponce <da_vid@HIDDEN> writes:

> On 30/03/2024 20:44, Joseph Turner wrote:
>> With the resolution of bug#69992, it may be possible to remove the
>> `image-tests--map-equal' equality predicate from lisp/image-tests.el.
>> Eli and David, would you please apply the attached patch and then
>> run
>> the tests to see if we still need to allow for tolerances in
>> `image--compute-map-and-original-map'?
>> The tests pass for me, but then again, they never failed on my
>> machine...
>> Thank you!! I'm grateful for this fun collaboration. :)
>> Joseph
>>
>
> Hi Joseph,
>
> Did you forget to attach the patch? I cannot find it.

Apologies.  Here it is.  (This is the same patch as in my response to Eli)

> Anyway, I don't think the resolution of bug#69992 changed anything
> regarding the test `image--compute-map-and-original-map'.  And to
> be honest I don't understand why it gives a different result on our
> configurations.

I thought perhaps calculating scale with

(/ (float (car size))
                     (car (image-size
                           (image--image-without-parameters image) t)))

instead of

(or (image-property image :scale) 1)

would fix the variations on our machines.

> To test, I also eval the following simple code in *scratch* buffer,
> which gives me consistent results on my laptop:
>
> (let* ((svg (svg-create 200 100))
>        (omap `(((rect . ((0 . 0) . (50 . 50)))
>                 rect-test (help-echo "rect-test"))
>                ((circle . ((85 . 55) . 25))
>                 circle-test (help-echo "circle-test"))
>                ((poly . [100 0 125 0 170 50 125 50])
>                 poly-test (help-echo "poly-test")))))
>   (svg-rectangle svg 0 0 50 50
>                  :stroke-width 0 :fill "red")
>   (svg-circle    svg 85 55 25
>                  :stroke-width 0 :fill "green")
>   (svg-polyline  svg '((100 . 0) (125 . 0) (170 . 50) (125 . 50))
>                  :stroke-width 0 :fill "blue")
>   (let ((image (svg-image svg
>                           :original-map omap
>                           :scale nil    ;; vary scale test
>                           :rotation nil ;; vary rotation test
>                           :flip nil     ;; vary flip test
>                           )))
>     ;; Must see the pointer and help-echo change when mouse hovers the
>     ;; rect, circle and poly hot spots.
>     (insert-image image)
>     (insert ?\n)
>     ;; Must see the same original map.
>     (image--compute-original-map image)))

This manual test also works on my machine.  I had been doing something
similar; I like your use of svg-create :)

Let me know if the unit tests pass with this patch applied.

Thank you!

Joseph


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-Compare-image-maps-with-equal-in-tests.patch

From e85fd88a2943fa95d2d7eea3a542308adaa81582 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@HIDDEN>
Date: Sat, 30 Mar 2024 12:38:52 -0700
Subject: [PATCH] Compare image maps with `equal' in tests

With the fixes to image map transformation introduced in cc212ea314d,
the tests should now exactly predict calculated image maps.

* test/lisp/image-tests.el (image-tests--map-equal): Remove function.
(image--compute-map-and-original-map): Use equal to compare image maps.
---
 test/lisp/image-tests.el | 46 +++++-----------------------------------
 1 file changed, 5 insertions(+), 41 deletions(-)

diff --git a/test/lisp/image-tests.el b/test/lisp/image-tests.el
index 020781eff50..41b87b8d337 100644
--- a/test/lisp/image-tests.el
+++ b/test/lisp/image-tests.el
@@ -178,37 +178,6 @@ image-create-image-with-map
            (got-original-map (image-property image :original-map)))
       (should (equal got-original-map original-map-other)))))
 
-(defun image-tests--map-equal (a b &optional tolerance)
-  "Return t if maps A and B have the same coordinates within TOLERANCE.
-Since image sizes calculations vary on different machines, this function
-allows for each image map coordinate in A to be within TOLERANCE to the
-corresponding coordinate in B.  When nil, TOLERANCE defaults to 5."
-  (unless tolerance (setq tolerance 5))
-  (catch 'different
-    (cl-labels ((check-tolerance
-                  (coord-a coord-b)
-                  (unless (>= tolerance (abs (- coord-a coord-b)))
-                    (throw 'different nil))))
-      (dotimes (i (length a))
-        (pcase-let ((`((,type-a . ,coords-a) ,_id ,_plist) (nth i a))
-                    (`((,type-b . ,coords-b) ,_id ,_plist) (nth i b)))
-          (unless (eq type-a type-b)
-            (throw 'different nil))
-          (pcase-exhaustive type-a
-            ('rect
-             (check-tolerance (caar coords-a) (caar coords-b))
-             (check-tolerance (cdar coords-a) (cdar coords-b))
-             (check-tolerance (cadr coords-a) (cadr coords-b))
-             (check-tolerance (cddr coords-a) (cddr coords-b)))
-            ('circle
-             (check-tolerance (caar coords-a) (caar coords-b))
-             (check-tolerance (cdar coords-a) (cdar coords-b))
-             (check-tolerance (cdar coords-a) (cdar coords-b)))
-            ('poly
-             (dotimes (i (length coords-a))
-               (check-tolerance (aref coords-a i) (aref coords-b i))))))))
-    t))
-
 (ert-deftest image--compute-map-and-original-map ()
   "Test `image--compute-map' and `image--compute-original-map'."
   (skip-unless (display-images-p))
@@ -237,25 +206,20 @@ image--compute-map-and-original-map
                               :scale 2 :rotation 90 :flip t)))
     ;; Test that `image--compute-original-map' correctly generates
     ;; original-map when creating an already transformed image.
-    (should (image-tests--map-equal (image-property image :original-map)
-                                    original-map))
+    (should (equal (image-property image :original-map) original-map))
     (setf (image-property image :flip) nil)
     (setf (image-property image :rotation) 0)
     (setf (image-property image :scale) 2)
-    (should (image-tests--map-equal (image--compute-map image)
-                                    scaled-map))
+    (should (equal (image--compute-map image) scaled-map))
     (setf (image-property image :scale) 1)
     (setf (image-property image :rotation) 90)
-    (should (image-tests--map-equal (image--compute-map image)
-                                    rotated-map))
+    (should (equal (image--compute-map image) rotated-map))
     (setf (image-property image :rotation) 0)
     (setf (image-property image :flip) t)
-    (should (image-tests--map-equal (image--compute-map image)
-                                    flipped-map))
+    (should (equal (image--compute-map image) flipped-map))
     (setf (image-property image :scale) 2)
     (setf (image-property image :rotation) 90)
-    (should (image-tests--map-equal (image--compute-map image)
-                                    scaled-rotated-flipped-map))
+    (should (equal (image--compute-map image) scaled-rotated-flipped-map))
 
     ;; Uncomment to test manually by interactively transforming the
     ;; image and checking the map boundaries by hovering them.
-- 
2.41.0


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70093; Package emacs. Full text available.

Message received at 70093 <at> debbugs.gnu.org:


Received: (at 70093) by debbugs.gnu.org; 31 Mar 2024 07:34:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 31 03:34:14 2024
Received: from localhost ([127.0.0.1]:46504 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rqphm-0006bp-Aq
	for submit <at> debbugs.gnu.org; Sun, 31 Mar 2024 03:34:14 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:58566)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rqphi-0006bS-S7
 for 70093 <at> debbugs.gnu.org; Sun, 31 Mar 2024 03:34:13 -0400
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 <eliz@HIDDEN>)
 id 1rqphZ-000246-On; Sun, 31 Mar 2024 03:34:01 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=JaeCJE42Vy8nPYNwZSp+cH6U5BqlS58JmcKhC7kySpI=; b=nmlIU3OhL/oN
 mRKPJ+1RSk8QJM/miYAVkfa/WmN//x+vgLR98pHgaTcLqtJuMjtssrk8VrcuhcQMILXMdvA4EKIJ5
 cJIP/vKGFOoR3qZhOkHYnjKyNMHTSllNpleBC3NP/lI5cJ0jD+0M+mPysBGadhHMdNPb/kSRqKn82
 xoVxLxbNGudPo/wWtJFAA24xQctyZszZTEfjxvYspSzkdEcW2yERFS+BfUwDviAJNqexo6CS3ZepU
 O4BMy6lZvVpzaOpOkPdu3cEpRaVYG7hyeF+mdS6vuUXQ5WAqNkNv5YceFjjOLHhOX2p76OD2dZ/Mr
 bMP+2xkX7K0rN3BhkJ6Q7Q==;
Date: Sun, 31 Mar 2024 10:33:53 +0300
Message-Id: <86o7auc0ta.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Joseph Turner <joseph@HIDDEN>
In-Reply-To: <8734s7c6cv.fsf@HIDDEN> (message from Joseph Turner
 on Sat, 30 Mar 2024 22:32:26 -0700)
Subject: Re: bug#70093: Remove unnecessary `image-tests--map-equal'
References: <877chjcxfg.fsf@HIDDEN> <86y19zaswg.fsf@HIDDEN>
 <8734s7c6cv.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70093
Cc: 70093 <at> debbugs.gnu.org, da_vid@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Joseph Turner <joseph@HIDDEN>
> Cc: 70093 <at> debbugs.gnu.org, da_vid@HIDDEN
> Date: Sat, 30 Mar 2024 22:32:26 -0700
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> Cc: Eli Zaretskii <eliz@HIDDEN>, David Ponce <da_vid@HIDDEN>
> >> From: Joseph Turner <joseph@HIDDEN>
> >> Date: Sat, 30 Mar 2024 12:44:14 -0700
> >>
> >> With the resolution of bug#69992, it may be possible to remove the
> >> `image-tests--map-equal' equality predicate from lisp/image-tests.el.
> >
> > Why is it a good idea to remove tests?  If the test tests some of our
> > code which should work as the test assumes, we should not remove it.
> 
> Not removing tests, but rather making the tests more strict (if possible).
> 
> >> Eli and David, would you please apply the attached patch and then run
> >> the tests to see if we still need to allow for tolerances in
> >> `image--compute-map-and-original-map'?
> >
> > ENOPATCH
> 
> Sorry about that.  Please check if the tests still pass on your machine
> when we use `equal' to compare image maps.

They pass, thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70093; Package emacs. Full text available.

Message received at 70093 <at> debbugs.gnu.org:


Received: (at 70093) by debbugs.gnu.org; 31 Mar 2024 05:34:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 31 01:34:26 2024
Received: from localhost ([127.0.0.1]:46456 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rqnpp-0007sV-LU
	for submit <at> debbugs.gnu.org; Sun, 31 Mar 2024 01:34:26 -0400
Received: from out-178.mta0.migadu.com ([91.218.175.178]:50613)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joseph@HIDDEN>) id 1rqnpl-0007re-QH
 for 70093 <at> debbugs.gnu.org; Sun, 31 Mar 2024 01:34:23 -0400
References: <877chjcxfg.fsf@HIDDEN> <86y19zaswg.fsf@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; 
 s=key1; t=1711863253;
 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:
 in-reply-to:in-reply-to:references:references;
 bh=hxYqH5J/FVnsw3upy44OisHka3X4yORqr9eG96WT794=;
 b=WvLbZD6LJQm75CcqsqxD1X2sw9UgMbyLHFsdV4ir5/WB1fG3FSRc5bt+uhVIIJUKtmqXoO
 uHGOVY1gxX9KNtmvgR5izIk6qary/2X+RCJPhyT+5ye0snEfRJrRu/ZCQY+VMKIMwH9JZ9
 H4T/oOK6HJ1VL3INcfJSfxmz81VkV4c=
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
From: Joseph Turner <joseph@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#70093: Remove unnecessary `image-tests--map-equal'
Date: Sat, 30 Mar 2024 22:32:26 -0700
In-reply-to: <86y19zaswg.fsf@HIDDEN>
Message-ID: <8734s7c6cv.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70093
Cc: 70093 <at> debbugs.gnu.org, da_vid@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain


Eli Zaretskii <eliz@HIDDEN> writes:

>> Cc: Eli Zaretskii <eliz@HIDDEN>, David Ponce <da_vid@HIDDEN>
>> From: Joseph Turner <joseph@HIDDEN>
>> Date: Sat, 30 Mar 2024 12:44:14 -0700
>>
>> With the resolution of bug#69992, it may be possible to remove the
>> `image-tests--map-equal' equality predicate from lisp/image-tests.el.
>
> Why is it a good idea to remove tests?  If the test tests some of our
> code which should work as the test assumes, we should not remove it.

Not removing tests, but rather making the tests more strict (if possible).

>> Eli and David, would you please apply the attached patch and then run
>> the tests to see if we still need to allow for tolerances in
>> `image--compute-map-and-original-map'?
>
> ENOPATCH

Sorry about that.  Please check if the tests still pass on your machine
when we use `equal' to compare image maps.


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-Compare-image-maps-with-equal-in-tests.patch

From e85fd88a2943fa95d2d7eea3a542308adaa81582 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@HIDDEN>
Date: Sat, 30 Mar 2024 12:38:52 -0700
Subject: [PATCH] Compare image maps with `equal' in tests

With the fixes to image map transformation introduced in cc212ea314d,
the tests should now exactly predict calculated image maps.

* test/lisp/image-tests.el (image-tests--map-equal): Remove function.
(image--compute-map-and-original-map): Use equal to compare image maps.
---
 test/lisp/image-tests.el | 46 +++++-----------------------------------
 1 file changed, 5 insertions(+), 41 deletions(-)

diff --git a/test/lisp/image-tests.el b/test/lisp/image-tests.el
index 020781eff50..41b87b8d337 100644
--- a/test/lisp/image-tests.el
+++ b/test/lisp/image-tests.el
@@ -178,37 +178,6 @@ image-create-image-with-map
            (got-original-map (image-property image :original-map)))
       (should (equal got-original-map original-map-other)))))
 
-(defun image-tests--map-equal (a b &optional tolerance)
-  "Return t if maps A and B have the same coordinates within TOLERANCE.
-Since image sizes calculations vary on different machines, this function
-allows for each image map coordinate in A to be within TOLERANCE to the
-corresponding coordinate in B.  When nil, TOLERANCE defaults to 5."
-  (unless tolerance (setq tolerance 5))
-  (catch 'different
-    (cl-labels ((check-tolerance
-                  (coord-a coord-b)
-                  (unless (>= tolerance (abs (- coord-a coord-b)))
-                    (throw 'different nil))))
-      (dotimes (i (length a))
-        (pcase-let ((`((,type-a . ,coords-a) ,_id ,_plist) (nth i a))
-                    (`((,type-b . ,coords-b) ,_id ,_plist) (nth i b)))
-          (unless (eq type-a type-b)
-            (throw 'different nil))
-          (pcase-exhaustive type-a
-            ('rect
-             (check-tolerance (caar coords-a) (caar coords-b))
-             (check-tolerance (cdar coords-a) (cdar coords-b))
-             (check-tolerance (cadr coords-a) (cadr coords-b))
-             (check-tolerance (cddr coords-a) (cddr coords-b)))
-            ('circle
-             (check-tolerance (caar coords-a) (caar coords-b))
-             (check-tolerance (cdar coords-a) (cdar coords-b))
-             (check-tolerance (cdar coords-a) (cdar coords-b)))
-            ('poly
-             (dotimes (i (length coords-a))
-               (check-tolerance (aref coords-a i) (aref coords-b i))))))))
-    t))
-
 (ert-deftest image--compute-map-and-original-map ()
   "Test `image--compute-map' and `image--compute-original-map'."
   (skip-unless (display-images-p))
@@ -237,25 +206,20 @@ image--compute-map-and-original-map
                               :scale 2 :rotation 90 :flip t)))
     ;; Test that `image--compute-original-map' correctly generates
     ;; original-map when creating an already transformed image.
-    (should (image-tests--map-equal (image-property image :original-map)
-                                    original-map))
+    (should (equal (image-property image :original-map) original-map))
     (setf (image-property image :flip) nil)
     (setf (image-property image :rotation) 0)
     (setf (image-property image :scale) 2)
-    (should (image-tests--map-equal (image--compute-map image)
-                                    scaled-map))
+    (should (equal (image--compute-map image) scaled-map))
     (setf (image-property image :scale) 1)
     (setf (image-property image :rotation) 90)
-    (should (image-tests--map-equal (image--compute-map image)
-                                    rotated-map))
+    (should (equal (image--compute-map image) rotated-map))
     (setf (image-property image :rotation) 0)
     (setf (image-property image :flip) t)
-    (should (image-tests--map-equal (image--compute-map image)
-                                    flipped-map))
+    (should (equal (image--compute-map image) flipped-map))
     (setf (image-property image :scale) 2)
     (setf (image-property image :rotation) 90)
-    (should (image-tests--map-equal (image--compute-map image)
-                                    scaled-rotated-flipped-map))
+    (should (equal (image--compute-map image) scaled-rotated-flipped-map))
 
     ;; Uncomment to test manually by interactively transforming the
     ;; image and checking the map boundaries by hovering them.
-- 
2.41.0


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70093; Package emacs. Full text available.

Message received at 70093 <at> debbugs.gnu.org:


Received: (at 70093) by debbugs.gnu.org; 31 Mar 2024 05:10:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 31 01:10:21 2024
Received: from localhost ([127.0.0.1]:46441 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rqnSX-0006MJ-DS
	for submit <at> debbugs.gnu.org; Sun, 31 Mar 2024 01:10:21 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:56404)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rqnST-0006LR-IS
 for 70093 <at> debbugs.gnu.org; Sun, 31 Mar 2024 01:10:20 -0400
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 <eliz@HIDDEN>)
 id 1rqnSL-0005JV-Dj; Sun, 31 Mar 2024 01:10:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=34wk3V+vlvD3fuU3ih5ohoxo8Z62k4jssT1UeLYnPVs=; b=Kj0BBPlnsvHR
 2pu3uYMH8HXgoIiplYLJoU1kV6CaC2rxl6rAckqVq1t3H88sugP2xP5EZnYk7DWMgZqhMxkoNfP2t
 bKSMg3BFKK0x6NmnbPIMLwgKCRqXIotloyPDEbXTH6eGWTK+nBfPtnKAp7KbsAYBe+P5c6jlz4MkF
 jX7m8i5g54dCLFTseoe8QA1MbVMpZjyXuu9LwLF/8No+eyToFY5Iu0qHY3DDyNJECpAsOLhE7duOf
 R0kax/Fnqgw8sSvCk6Btn01etw/X8jxkynsrkpcHcOiCZ8430xYjTl/H5pGnaJjSolkHt/4kJv8GM
 4tyeI+wk1wdHGkFu8hdiGg==;
Date: Sun, 31 Mar 2024 08:10:07 +0300
Message-Id: <86y19zaswg.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Joseph Turner <joseph@HIDDEN>
In-Reply-To: <877chjcxfg.fsf@HIDDEN> (message from Joseph Turner
 on Sat, 30 Mar 2024 12:44:14 -0700)
Subject: Re: bug#70093: Remove unnecessary `image-tests--map-equal'
References: <877chjcxfg.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70093
Cc: 70093 <at> debbugs.gnu.org, da_vid@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: Eli Zaretskii <eliz@HIDDEN>, David Ponce <da_vid@HIDDEN>
> From: Joseph Turner <joseph@HIDDEN>
> Date: Sat, 30 Mar 2024 12:44:14 -0700
> 
> With the resolution of bug#69992, it may be possible to remove the
> `image-tests--map-equal' equality predicate from lisp/image-tests.el.

Why is it a good idea to remove tests?  If the test tests some of our
code which should work as the test assumes, we should not remove it.

> Eli and David, would you please apply the attached patch and then run
> the tests to see if we still need to allow for tolerances in
> `image--compute-map-and-original-map'?

ENOPATCH




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70093; Package emacs. Full text available.

Message received at 70093 <at> debbugs.gnu.org:


Received: (at 70093) by debbugs.gnu.org; 30 Mar 2024 22:04:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 30 18:04:38 2024
Received: from localhost ([127.0.0.1]:46267 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rqgoY-0001ML-06
	for submit <at> debbugs.gnu.org; Sat, 30 Mar 2024 18:04:38 -0400
Received: from msa-210.smtpout.orange.fr ([193.252.23.210]:61085
 helo=msa.smtpout.orange.fr)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <da_vid@HIDDEN>) id 1rqgoT-0001Le-97
 for 70093 <at> debbugs.gnu.org; Sat, 30 Mar 2024 18:04:36 -0400
Received: from [192.168.1.15] ([2.7.71.181]) by smtp.orange.fr with ESMTPA
 id qgoOrzfTX3JsoqgoOrlaSe; Sat, 30 Mar 2024 23:04:29 +0100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.fr;
 s=t20230301; t=1711836269;
 bh=z+dZECgXy1BRoXCvaCT/8Ry2qTN+v9vjQr3Qi/L3dbY=;
 h=Message-ID:Date:MIME-Version:Subject:To:From;
 b=rfTggW3La61zDbwwfw4oo/+wN5rVUMobHwUEDkXo/cTVQfhgIxXFv6LEhMI6HmrqM
 DvFWJxUueG6H5hUa704MSYj1XO4n23GIW/Ov/Vhq7rf5Vp35iL5jEe2v111QXiTrxQ
 w9U3vn60x0VO00HfH18I6ypkBPxoxEBzZsOvQTqTY7bfEj0OdIxWB1Yc5v8uqvydGS
 jhpEB/iMGF7T3TSjdtliWU/+aLy8A5RGUIbbLBNHOXqQhXS9jfHSvcORlPon2w6G8j
 INdBTEpKp44NfTaUKrAsabbxJHWFIDsahV22D/EN+C9SBBm7SfRtLpUHwGXXuuypw7
 WgbpPbMKR3YKA==
X-ME-Helo: [192.168.1.15]
X-ME-Auth: ZGFfdmlkQHdhbmFkb28uZnI=
X-ME-Date: Sat, 30 Mar 2024 23:04:29 +0100
X-ME-IP: 2.7.71.181
Message-ID: <1d1367e3-d888-4a00-8204-1bb6c3607801@HIDDEN>
Date: Sat, 30 Mar 2024 23:04:28 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: *** SPAM *** bug#70093: Remove unnecessary
 `image-tests--map-equal'
To: Joseph Turner <joseph@HIDDEN>, 70093 <at> debbugs.gnu.org
References: <877chjcxfg.fsf@HIDDEN>
Content-Language: fr, en-US
From: David Ponce <da_vid@HIDDEN>
In-Reply-To: <877chjcxfg.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 70093
Cc: Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 30/03/2024 20:44, Joseph Turner wrote:
> With the resolution of bug#69992, it may be possible to remove the
> `image-tests--map-equal' equality predicate from lisp/image-tests.el.
> 
> Eli and David, would you please apply the attached patch and then run
> the tests to see if we still need to allow for tolerances in
> `image--compute-map-and-original-map'?
> 
> The tests pass for me, but then again, they never failed on my machine...
> 
> Thank you!! I'm grateful for this fun collaboration. :)
> 
> Joseph
> 
> 

Hi Joseph,

Did you forget to attach the patch? I cannot find it.

Anyway, I don't think the resolution of bug#69992 changed anything
regarding the test `image--compute-map-and-original-map'.  And to
be honest I don't understand why it gives a different result on our
configurations.

To test, I also eval the following simple code in *scratch* buffer,
which gives me consistent results on my laptop:

(let* ((svg (svg-create 200 100))
        (omap `(((rect . ((0 . 0) . (50 . 50)))
                 rect-test (help-echo "rect-test"))
                ((circle . ((85 . 55) . 25))
                 circle-test (help-echo "circle-test"))
                ((poly . [100 0 125 0 170 50 125 50])
                 poly-test (help-echo "poly-test")))))
   (svg-rectangle svg 0 0 50 50
                  :stroke-width 0 :fill "red")
   (svg-circle    svg 85 55 25
                  :stroke-width 0 :fill "green")
   (svg-polyline  svg '((100 . 0) (125 . 0) (170 . 50) (125 . 50))
                  :stroke-width 0 :fill "blue")
   (let ((image (svg-image svg
                           :original-map omap
                           :scale nil    ;; vary scale test
                           :rotation nil ;; vary rotation test
                           :flip nil     ;; vary flip test
                           )))
     ;; Must see the pointer and help-echo change when mouse hovers the
     ;; rect, circle and poly hot spots.
     (insert-image image)
     (insert ?\n)
     ;; Must see the same original map.
     (image--compute-original-map image)))

Thanks!




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70093; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 30 Mar 2024 19:49:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 30 15:49:40 2024
Received: from localhost ([127.0.0.1]:46180 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rqehv-0002Xr-NY
	for submit <at> debbugs.gnu.org; Sat, 30 Mar 2024 15:49:39 -0400
Received: from lists.gnu.org ([2001:470:142::17]:59854)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joseph@HIDDEN>) id 1rqehu-0002XW-8k
 for submit <at> debbugs.gnu.org; Sat, 30 Mar 2024 15:49:38 -0400
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 <joseph@HIDDEN>)
 id 1rqehm-0002jo-S2
 for bug-gnu-emacs@HIDDEN; Sat, 30 Mar 2024 15:49:30 -0400
Received: from out-186.mta0.migadu.com ([91.218.175.186])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <joseph@HIDDEN>)
 id 1rqehl-0000Fa-Ce
 for bug-gnu-emacs@HIDDEN; Sat, 30 Mar 2024 15:49:30 -0400
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; 
 s=key1; t=1711828167;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type;
 bh=mr/6/Yo1bAHUQKblIBeHyfJOfuPir5+x6thAoa58sTA=;
 b=RJpzvgngU94ACli7aqmFkqMIX0yt7M460guVCTBg/SJ2vxj056TEmBUkYfbOknSGIe7AlD
 CjoqNlB1GOBVxfg1EJc7R5qGal8EhOsW9S6IVaRbOLaUV5vxx4kC20ekUfnN6degjIWy6R
 8llWYxIuzGrbMnQCcsKbFGb9MpPv1l0=
From: Joseph Turner <joseph@HIDDEN>
To: Emacs Bugs Mailing List <bug-gnu-emacs@HIDDEN>
Subject: Remove unnecessary `image-tests--map-equal'
Date: Sat, 30 Mar 2024 12:44:14 -0700
X-Debbugs-Cc: Eli Zaretskii <eliz@HIDDEN>, David Ponce <da_vid@HIDDEN>
Message-ID: <877chjcxfg.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Migadu-Flow: FLOW_OUT
Received-SPF: pass client-ip=91.218.175.186;
 envelope-from=joseph@HIDDEN; helo=out-186.mta0.migadu.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

With the resolution of bug#69992, it may be possible to remove the
`image-tests--map-equal' equality predicate from lisp/image-tests.el.

Eli and David, would you please apply the attached patch and then run
the tests to see if we still need to allow for tolerances in
`image--compute-map-and-original-map'?

The tests pass for me, but then again, they never failed on my machine...

Thank you!! I'm grateful for this fun collaboration. :)

Joseph




Acknowledgement sent to Joseph Turner <joseph@HIDDEN>:
New bug report received and forwarded. Copy sent to eliz@HIDDEN, da_vid@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to eliz@HIDDEN, da_vid@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#70093; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 6 Apr 2024 02:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.