From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thomas =?UTF-8?Q?H=C3=BChn?= Newsgroups: gmane.emacs.bugs Subject: bug#58101: 28.2; image-size nonsensical Date: Tue, 27 Sep 2022 11:00:22 +0200 Message-ID: <1a31e408-ea01-7e86-d6ac-e45fda14ddb5@2uo.de> References: <06754647-2195-d85d-1f1b-f75a59985699@2uo.de> <83tu4tjqsh.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34448"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Cc: Eli Zaretskii To: 58101@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 27 19:07:59 2022 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 1odE3q-0008il-N7 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Sep 2022 19:07:59 +0200 Original-Received: from localhost ([::1]:47482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odE3o-00035H-Uy for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Sep 2022 13:07:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odDX1-0005eE-Od for bug-gnu-emacs@gnu.org; Tue, 27 Sep 2022 12:34:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57564) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1odDX0-0007vU-Fr for bug-gnu-emacs@gnu.org; Tue, 27 Sep 2022 12:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1odDX0-0004B6-9j for bug-gnu-emacs@gnu.org; Tue, 27 Sep 2022 12:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thomas =?UTF-8?Q?H=C3=BChn?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Sep 2022 16:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58101 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 58101-submit@debbugs.gnu.org id=B58101.166429643016015 (code B ref 58101); Tue, 27 Sep 2022 16:34:02 +0000 Original-Received: (at 58101) by debbugs.gnu.org; 27 Sep 2022 16:33:50 +0000 Original-Received: from localhost ([127.0.0.1]:56634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odDWn-0004AD-94 for submit@debbugs.gnu.org; Tue, 27 Sep 2022 12:33:50 -0400 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:35565) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1od6S7-0003Io-UW for 58101@debbugs.gnu.org; Tue, 27 Sep 2022 05:00:32 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 27B223200992; Tue, 27 Sep 2022 05:00:26 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 27 Sep 2022 05:00:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2uo.de; h=cc:cc :content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1664269225; x= 1664355625; bh=+ULeHx+ch8NXLL8jn8U2OArku+QTIaZngKcof0zV+ck=; b=D cqeI8rLlVL2DXI8ep+iRhMV0o5aewzkbM82wuzJ8A1vhc3NOdSdrmJPSntrWwZ0U cs0L4rbb9/M4u7aXxkFX6oKNCglFOpz93sjcfEonR6NTwluyLc9kYS1KkaIKFLzI wyLhSk+4tTQgor65VZlYPBPxMs9+1wQN15BkRFswxDa7ty6Syqyni1ONdTV1WzJl On5TZQvVVB3jrJgeKOjEeYFB0udfngilqLhhFR4tam2RT8/L7ykkuNZ02uvnOcd6 2fQEtTTol9zaD3Yx9/IRr+icCjLjaPXsjspcNPXbiqLAbAyYK4qFNjT9K16xOPNU IUwqMG9NN0HW2k4UJtViQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1664269225; x= 1664355625; bh=+ULeHx+ch8NXLL8jn8U2OArku+QTIaZngKcof0zV+ck=; b=R omGTqI51puFROlf7Z7UJV8DtZRWqA5KN9XakFlpz7wd1XShAD3BRfpg2HuoSogDR FF+m0DByXV2AADnLiXXLeNwik6oOE89VqgEmPufkOcS68amcgR7/F1oGE2jVq5Jz neZiEq9bCd8MeW5RUOfkVz+ulhODNeWpcBacaaVXM6HxEOKS4xQeRBBwFgR/8KAG PB2Z7FVMtDttMcTpvck0SOPgqHx8RfeH4CCpdR4RIWXjIHd7l6toTuemTCrrfKpw uR+f9ck1TUpdCowRc6zIv9gdINtefnhB61OG4hcndEKUV5tvYsmou3joeCrPa8kP Ip3KKazKUPz2ZHKsMWA7w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeggedgtdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfufhfhfevvfgjtgfgsehtkeertddtfeejnecuhfhrohhmpefvhhho mhgrshgpjfpthhhnuceothesvdhuohdruggvqeenucggtffrrghtthgvrhhnpeelleelud fgueduffdvvdduffffheekleffvdejvedtiefgveelteelieefleduveenucffohhmrghi nhepgihktggurdgtohhmpdhstghhohgvnhgvqdhkihhnuggvrhgsuhgvtghhvghrrdguvg dpthhhohhmrghsqdhhuhgvhhhnrdguvgenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpehtsedvuhhordguvg X-ME-Proxy: Feedback-ID: i5000408d:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 27 Sep 2022 05:00:24 -0400 (EDT) Content-Language: en-US In-Reply-To: <83tu4tjqsh.fsf@gnu.org> X-Mailman-Approved-At: Tue, 27 Sep 2022 12:33:48 -0400 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" Xref: news.gmane.io gmane.emacs.bugs:243749 Archived-At: Hi, first of all, I think this bug could be merged with #52931, I found that only afterwards. On 27.09.2022 08:05, Eli Zaretskii wrote: >> Date: Mon, 26 Sep 2022 20:41:45 +0200 >> From: Thomas Hühn >> >> * Download image https://imgs.xkcd.com/comics/two_key_system_2x.png to >> disk >> >> * Run (create-image "two_key_system_2x.png") --> (image :type png :file >> "two_key_system_2x.png" :scale 1.2038461538461538 :transform-smoothing >> t) >> >> * Run (image-size (create-image "two_key_system_2x.png") :pixels) --> >> (30 . 30) >> >> Expected result: (1291 . 632) > > I cannot reproduce this here. I get the expected result. I also get Now it seems like it's an intermittent problem. Until yesterday (for several weaks where I've tried it every now and then) it resulted in what I wrote in this bug. Then I found #52931 and tried Markus' lines. In my opinion, (image-size (create-image "two_key_system_2x.png") :pixels) and (let ((img (create-image "two_key_system_2x.png"))) (image-size img t)) should give the same result, but it didn't! Markus' line gave 1554 . 760, mine gave 30 . 30. Later yesterday evening both gave 1554 . 760. After some googling I found image-scaling-factor, and after setting that to 1, I always get the expected 1291 . 632 now. (By the way, I think image-size should ignore that variable – I'm not displaying the image anywhere, so any display scaling shouldn't interfere – my use case would be inserting width and height attributes in HTML where I certainly want the original image dimensions) > this result from create-image: > > (image :type png :file "two_key_system_2x.png" :scale 1 :transform-smoothing t) With emacs -Q: (image :type png :file "two_key_system_2x.png" :scale 1.2 :transform-smoothing t) That scaling factor is different now. I'll continue with emacs -Q from now on. > Is this in "emacs -Q"? If so, what version of libpng do you have mingw64/mingw-w64-x86_64-libpng 1.6.38-1 [installed] > installed there? And what happens if you start Emacs like this: > > emacs -Q --eval "(setq w32-use-native-image-API t)" (image-size (create-image "two_key_system_2x.png") :pixels) --> (1549 . 758) (let ((img (create-image "two_key_system_2x.png"))) (image-size img t)) --> (1549 . 758) Have a nice day! Thomas -- Wunderschön illustrierte Kinderbücher: https://www.schoene-kinderbuecher.de Weblog: https://www.thomas-huehn.de