From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.help Subject: Re: Get the actual width/height of an image Date: Mon, 14 Sep 2020 17:40:12 -0400 Message-ID: <421A2ADC-01F5-4395-A6F1-20F095B54D32@gmail.com> References: <28F86650-5F8B-41EC-BC39-54B083B1E394@gmail.com> <87y2lc3wt0.fsf@ebih.ebihd> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) 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="16148"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org, Emanuel Berg To: Corwin Brust Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 14 23:41:02 2020 Return-path: Envelope-to: geh-help-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 1kHwDe-00044J-Kr for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 14 Sep 2020 23:41:02 +0200 Original-Received: from localhost ([::1]:52864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHwDd-00049w-Mx for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 14 Sep 2020 17:41:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHwCu-00049q-6h for help-gnu-emacs@gnu.org; Mon, 14 Sep 2020 17:40:16 -0400 Original-Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]:35008) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kHwCs-0005bI-JJ for help-gnu-emacs@gnu.org; Mon, 14 Sep 2020 17:40:15 -0400 Original-Received: by mail-qt1-x82d.google.com with SMTP id p65so1477746qtd.2 for ; Mon, 14 Sep 2020 14:40:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=vDWq1Do28QuoIuDZZDvF8Witcw/Qv0x/yK7Cj8s8o7g=; b=fFAlMq0sHiEdmUvc7yvPttof+fT7S53EJLYx6BKvQB+cGDO+q0S954eYOFA9ceEH0B mYkx/+XULh+YwfE0Byk96k8FqS0raOFprOCexhSt6zRcNSn8f4CIpPyukKWj2oQsoLuL TgJ2bRZrdk8ZgLulOan2mcpIVNO8SmUJ+/Sc2JX7lrKpo/5nTGBG+HDa71NsOf9SuN5G eHSK+F1TJ3/X3F/aT6GRzAFvtyLyExkL7Th3mro5PO9IldPQpdZxuoUeOptYzs86NF6U 88CVtJVT8wrPwFGJzpZZ6mSvIg9nH5/W2eqhFOsR5SNum+HeE5/MjUoCGImTpXWMtAOW hm/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=vDWq1Do28QuoIuDZZDvF8Witcw/Qv0x/yK7Cj8s8o7g=; b=oc3DIYMziGOGbfxlt0/qj5AIzvfKk4TsxGCrDBxLTPSLKAH9stFh6Vp+FJSMkMm7d9 j++teiyeR54qGAeqdNONJXvLWP/Ek+Ae4r2Wd4fDKHNIUcenEZBZeEg2ZQxhISoTt1Jx EUByRr5I9Xe6Oy3DXcIaMMV7hbjfqcfGDKGapeI1L0OkYiMx/GHLcKqoo8KODTWlIjLQ 5+8LQqucgoZx1olb/QUjBOfSPTFpZGiGloDGuIZg87SXMLeTTMum/uwRWDUN1PMCMa/L nq7B78nxOEFv+/Hik/xsVuPzFOsDqXT2/XCYDrE/GReVoFQUjNw8EWJ311ydZ9aE5osB SYiA== X-Gm-Message-State: AOAM532ljo06q5uX3VoumndTB45ZRTcxIfWiDLBl7sup5jqEAicFsE3Q z/lV+9eh79sJtp/MjinFAx4= X-Google-Smtp-Source: ABdhPJwXMkKrt2jbc1XoOeW77q9lRPCBk1HuaMRbDdhMbR/5dGb6O3BgkyNnOkwMDz+bFT5IQOB7jg== X-Received: by 2002:ac8:3a06:: with SMTP id w6mr15353124qte.255.1600119613546; Mon, 14 Sep 2020 14:40:13 -0700 (PDT) Original-Received: from ?IPv6:2601:98a:4200:9210:f577:7c4:f377:74f? ([2601:98a:4200:9210:f577:7c4:f377:74f]) by smtp.gmail.com with ESMTPSA id u46sm14441680qth.31.2020.09.14.14.40.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2020 14:40:13 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3608.120.23.2.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::82d; envelope-from=casouri@gmail.com; helo=mail-qt1-x82d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:124051 Archived-At: > On Sep 14, 2020, at 5:18 PM, Corwin Brust wrote: >=20 > Greetings! >=20 > On Mon, Sep 14, 2020 at 3:53 PM Emanuel Berg via Users list for the > GNU Emacs text editor wrote: >>=20 >> Yuan Fu wrote: >>=20 >>> There doesn=E2=80=99t seem to be a function to get the >>> aspect ratio of the image, or the actual pixel >>> height/width of the image. So can I get >>> this information? >=20 >=20 > I think we can get the dimensions from `image-size', but note the > PIXELS argument: >=20 > (image-size SPEC &optional PIXELS FRAME) >=20 > | Documentation > | Return the size of image SPEC as pair (WIDTH . HEIGHT). >=20 > | PIXELS non-nil means return the size in pixels, otherwise return = the > | size in canonical character units. >=20 > | FRAME is the frame on which the image will be displayed. FRAME nil > | or omitted means use the selected frame. >=20 > | Calling this function will result in the image being stored in the > | image cache. If this is not desirable, call image-flush after > | calling this function. >=20 >=20 Wow, exactly what I want! Wonder why I missed it when reading Info. = Thanks! Yuan