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#69992: Minor improvement to image map transformation logic Date: Sat, 30 Mar 2024 12:07:05 -0700 Message-ID: <87bk6vcxoc.fsf@breatheoutbreathe.in> References: <87o7b3m8ee.fsf@ushin.org> <55864577-3819-46e0-857a-cc0d0145bc2f@orange.fr> <86cyrfj0t3.fsf@gnu.org> <87cyrfl265.fsf@breatheoutbreathe.in> <182126ee-57b1-4a86-82c6-ba46e4b676cb@orange.fr> <8634s8dtrp.fsf@gnu.org> <645a1ccd-868b-4e02-bfc3-0ce4ab6b8f38@orange.fr> Reply-To: Joseph Turner Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7126"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 69992@debbugs.gnu.org To: David Ponce Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 30 20:45:28 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 1rqedq-0001aV-Fb for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Mar 2024 20:45:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqedS-00026O-EZ; Sat, 30 Mar 2024 15:45:02 -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 1rqedQ-00025q-OF for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 15:45:00 -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 1rqedQ-0007rv-Es for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 15:45:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rqedR-00029B-VF for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 15:45: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, 30 Mar 2024 19:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69992 X-GNU-PR-Package: emacs Original-Received: via spool by 69992-submit@debbugs.gnu.org id=B69992.17118278618114 (code B ref 69992); Sat, 30 Mar 2024 19:45:01 +0000 Original-Received: (at 69992) by debbugs.gnu.org; 30 Mar 2024 19:44:21 +0000 Original-Received: from localhost ([127.0.0.1]:46175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqecm-00026n-U6 for submit@debbugs.gnu.org; Sat, 30 Mar 2024 15:44:21 -0400 Original-Received: from out-180.mta1.migadu.com ([2001:41d0:203:375::b4]:27372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqecj-00026W-E6 for 69992@debbugs.gnu.org; Sat, 30 Mar 2024 15:44:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1711827848; 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=y9TD7csfxJsaZU6j4ReB8fKCUIojkbmCpxasoAfLDjk=; b=JKjAqMIsbBN3Hds6Wuf6s1m19aDhRTX8UtjRbJEwcFBtKvY3/Aiwa3p21iew3OMUtaoMNb 6jzZpUVrBqdpuat+Fcf0mj/8Ec3pIpgZMnL6b5upvtXrfk6Nx93nwVWrMnCPveq7IuX20D +J0RWRXvgbGPz6MdIsIRMBi1ZidYcMc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: 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:282395 Archived-At: David Ponce writes: > Here is my last patch. The only change compared to the previous patch is that > now the scale factor is correctly calculated based on the size of the image and > the displayed size. To minimize the performance impact, I saved a call to > `image-size' by doing the calculation directly in the `image--compute-map' and > `image--compute-original-map' functions. I did some benchmarks and the > difference is not significant. The tests still give the same results :-) Thank you for these fixes and optimizations!!! The tests pass for me. > Here is the new change log: > > 2024-03-30 David Ponce > > * lisp/image.el (image--compute-rotation): New function. > (image--compute-map, image--compute-original-map): Use it. > Ensure all transformations are applied or undone according to what > Emacs does internally. Call a transformation function only when > needed. Fix doc string. With this fix, I think we can remove `image-tests--map-equal'. I'll submit a new bug. > (image--scale-map): Assume effective scale argument. > (image--rotate-map): Assume effective rotation argument. > (image--rotate-coord): Improve doc string. > (image--flip-map): Remove no more used flip argument. > > * test/lisp/image-tests.el (image-create-image-with-map): Use a > valid SVG image otherwise `image-size' will not return a valid > value and calculation of scale could fail. > (image-transform-map): Update according to changed signature of > image--flip-map. > > Thanks! > > [2. text/x-patch; image-compute-map-V2.patch]...