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: Get the actual width/height of an image Date: Mon, 14 Sep 2020 16:22:03 -0400 Message-ID: <28F86650-5F8B-41EC-BC39-54B083B1E394@gmail.com> 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="24414"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 14 22:22:29 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 1kHuzd-0006DU-1R for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 14 Sep 2020 22:22:29 +0200 Original-Received: from localhost ([::1]:46626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHuzc-0001oZ-4A for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 14 Sep 2020 16:22:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHuzH-0001oC-N9 for help-gnu-emacs@gnu.org; Mon, 14 Sep 2020 16:22:07 -0400 Original-Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]:38592) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kHuzG-0003s3-12 for help-gnu-emacs@gnu.org; Mon, 14 Sep 2020 16:22:07 -0400 Original-Received: by mail-qk1-x72b.google.com with SMTP id d20so1664777qka.5 for ; Mon, 14 Sep 2020 13:22:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=2YPl76YgDR4PCyCPPUIZXw6iJG7sw3s5YuJ/nNu8oBo=; b=ncDOpi8m1hpVXeEuhxhTCUHXUbgKyQwXmKv0M7SHsW3kv6QLonYvJ/pZ/XBl6B1HMD T/4DRdcdr6d+A92z4v2Ja38hXxpO9ehIxVwEBqp9uwJ/LIVnCxe3q+qZrWOshcn9u1Q9 J49ibZjnNxH2L5brMwK4Ent2rsHD5S2k220L2On5TV25GCIW1U1r9gct21XUpi4ROxu1 31+P5bCC5cqQdSPmQbzi2ad2bbk9mAiEKriok5fhxtjPyoCSvQtHNzrEZQV2XrYHH8kg QMnznptOjBeG6PfExRo5NODu30emj0eXcfNziCuVTuQi0UGOOyGL8sTH21/omHAoMZYM 4zNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=2YPl76YgDR4PCyCPPUIZXw6iJG7sw3s5YuJ/nNu8oBo=; b=adTYZaSQCrFCN+j05qUWmZUc6YhE2idGyV5brqJ5yJgWScNfYvl09qooNwm4KDHish awtx9t2o0P2uN/ILgndqeuPwGkru9jhvETJGO64+LPxfN7w8kihguSuEYQ06U0pMOmi8 hkRZdfprhsS2KEh1Kx3wiLdimhpJEWT4qz+DmTHTRvc11ad3oF5l6w2mPWC1qdHCb21r JBrtMjIALWSwv+0hEkBACIIhE2kEDQ2mOewe1LiwSIYnBev8RAeSDUkXKKBORofT/fUF 3ryWuU46svjMRcXQNYxM1oaPDYK8DVy4ugUAZY0dhPbmTztjK05bePf7gLsKx2k3jSv8 hMtA== X-Gm-Message-State: AOAM533SHSs8nYwlUR1mWmEUtHFWlQfD39CxSINbuc9egnK5OyAa/yfP eBxiKJeVZPu8R5E//ibk+w75J40E+IvTPsIK X-Google-Smtp-Source: ABdhPJx8OcZN4h7L6xlnqDCHfREr31wJHQZhEV2BVGOXfcrKp1IE5M85bvy+R7EafTdxjN07OHYSDA== X-Received: by 2002:a37:9c86:: with SMTP id f128mr14700737qke.30.1600114924829; Mon, 14 Sep 2020 13:22:04 -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 o28sm15902634qtl.62.2020.09.14.13.22.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2020 13:22:04 -0700 (PDT) X-Mailer: Apple Mail (2.3608.120.23.2.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::72b; envelope-from=casouri@gmail.com; helo=mail-qk1-x72b.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:124048 Archived-At: Here=E2=80=99s what I want to do: I want to show an image in slices, and = I want to be able to resize the image to certain width/height. For = example, I want to set the width of an image to, say, 300 pixels. IIUC, = to show the image in slices I need to now how many rows to use = (row-count =3D image-height / line-height). However, there is no way for = me to know what the height should be to make the width to be 300 pixels. = 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? Thanks, Yuan=