From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
Received: from mp11.migadu.com ([2001:41d0:8:6d80::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms5.migadu.com with LMTPS
	id yMIVN0NHHWMJ4QAAbAwnHQ
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sun, 11 Sep 2022 04:26:11 +0200
Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp11.migadu.com with LMTPS
	id 8EhEN0NHHWMzXgAA9RJhRA
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sun, 11 Sep 2022 04:26:11 +0200
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id 9DCD92DE34
	for <larch@yhetil.org>; Sun, 11 Sep 2022 04:26:11 +0200 (CEST)
Received: from localhost ([::1]:58550 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	id 1oXCfi-0006Uf-Fn
	for larch@yhetil.org; Sat, 10 Sep 2022 22:26:10 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:53316)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <numbchild@gmail.com>)
 id 1oXCfJ-0006UH-LK
 for emacs-orgmode@gnu.org; Sat, 10 Sep 2022 22:25:45 -0400
Received: from [39.171.214.225] (port=7603 helo=Mac-mini.local)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <numbchild@gmail.com>) id 1oXCfH-0000Fn-IG
 for emacs-orgmode@gnu.org; Sat, 10 Sep 2022 22:25:45 -0400
Received: by Mac-mini.local (Postfix, from userid 501)
 id 8B9A662EF0AD; Sun, 11 Sep 2022 10:25:36 +0800 (CST)
References: <PAXPR08MB6640301DBBDE78E3AC845CEDA39F9@PAXPR08MB6640.eurprd08.prod.outlook.com>
User-agent: mu4e 1.8.9; emacs 29.0.50
From: "Christopher M. Miles" <numbchild@gmail.com>
Cc: "Christopher M. Miles" <numbchild@gmail.com>, emacs-orgmode@gnu.org
Subject: [SOLVED] Re: [QUESTION] How to specific image size attributes under
 headline scope?
Date: Sun, 11 Sep 2022 10:25:17 +0800
In-reply-to: <PAXPR08MB6640301DBBDE78E3AC845CEDA39F9@PAXPR08MB6640.eurprd08.prod.outlook.com>
Message-ID: <m2pmg2640w.fsf@numbchild@gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Host-Lookup-Failed: Reverse DNS lookup failed for 39.171.214.225 (deferred)
Received-SPF: softfail client-ip=39.171.214.225;
 envelope-from=numbchild@gmail.com; helo=Mac-mini.local
X-Spam_score_int: 68
X-Spam_score: 6.8
X-Spam_bar: ++++++
X-Spam_report: (6.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001,
 FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, MISSING_HEADERS=1.021,
 MSGID_MULTIPLE_AT=1, NML_ADSP_CUSTOM_MED=0.9, RCVD_IN_PBL=3.335,
 RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665,
 SPOOFED_FREEMAIL_NO_RDNS=0.019,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no
X-Spam_action: reject
X-BeenThere: emacs-orgmode@gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Reply-To: numbchild@gmail.com
Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
Sender: "Emacs-orgmode" <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
X-Migadu-Flow: FLOW_IN
X-Migadu-To: larch@yhetil.org
X-Migadu-Country: US
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1662863171;
	h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date:
	 message-id:message-id:to:cc:cc:mime-version:mime-version:
	 content-type:content-type:in-reply-to:in-reply-to:
	 references:references:list-id:list-help:list-unsubscribe:
	 list-subscribe:list-post; bh=WCg7vJfeZti/Mm0U8y8rtxWS8mV0l8Nu5KqKkXaaf6I=;
	b=rVjxWA7Ntai5JXt21AqwfJCkwnZkw2OMUyr6OYp8Vpni9Y460uY0pdfXoFRGdCYfLc0nQP
	iOlboIgvz2fD98GDhWnV1ZSyQJY1zqtfKXcIPcJcK6loj++d9Z8oIhw4Ty/Q8NDwAgvEwi
	Eo6CeQWQG7KiT4YmrWfcUaGvENNfzjNopGbOXGd0rOCWF15TWFgNRWzqdGWmUbJP1hdH3J
	TI+IE5PKhoU0pMJt7BaVsWNJiVPPp14tdsBqPcZgTTez+8v8tcGDxpLk8x2uYhzqb2dFtE
	QMgfpviR1ByB4BaRFNaatzpugVmtPCGbNQwWL7Gd00ATvcadMiOFcZg1m5m8MQ==
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662863171; a=rsa-sha256; cv=none;
	b=sWBXYxE3ahUnwVDDnAIvfZdqnJa4NXlHa/ko1ulmG8PSWmcK0cgNHsSUmPh2CraRJULvJK
	N+ZTax+B+zNFcn/qHRRol4WhjseGRysPOLWHG32cfOxqSat3PRiHxMkTUEtdrEI76KsIa8
	BUlsLtLlDBQQjORabwP7AUJRCstpwa9OoWkp4bDurvTJTIbiOA8auCJenWTdQr+Vhq6Cb3
	Pqaj6TzwOkoqdpEyBwPKULPN99lIgX/qgXJqc+JY0KUUm/+5Rjl/INv5Ig+32KLLqAl7cx
	u19ZYSyHjV7dPi/QlsrXbyXakqB2uuR/zzoYH7LPuHjmGvYTKmSOWq0jmRLXcg==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=none;
	dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none);
	spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"
X-Migadu-Spam-Score: 4.80
Authentication-Results: aspmx1.migadu.com;
	dkim=none;
	dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none);
	spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"
X-Migadu-Queue-Id: 9DCD92DE34
X-Spam-Score: 4.80
X-Migadu-Scanner: scn1.migadu.com
X-TUID: 9grlOmE3xrXy

--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable


"Christopher M. Miles" <numbchild@gmail.com> writes:

> [[PGP Signed Part:Undecided]]
> There is attributes setting above image link to specify image inline prev=
iew size. Like this:
>
> #+begin_src org
> ,#+ATTR_ORG: :width 500
> ,#+ATTR_LATEX: :width 5.0in
> ,#+ATTR_HTML: :width 500px
> [[file:kk/88320740_p0.jpg]]
>
> #+end_src
>
> When I put it on beginning of org document, then preview inline images, b=
ut those global attributes
> not affected. The inline images still display in actual image size. I wan=
t to specify image size
> under headline properties. Is it possible to do this?

I implemented this feature by written a hook. Hope this can be helpful
for someone who also has this needs. Here is the code:

#+begin_src emacs-lisp
;;; auto display inline images under current TAB cycle expanded "visible" s=
ubtree.
(defun org-display-subtree-with-inline-images (&optional state)
  "Toggle the display of inline images under current expanded visible subtr=
ee.
INCLUDE-LINKED is passed to `org-display-inline-images'."
  (interactive)
  ;; (not (memq state '(overview folded contents))) ; global state change
  (let ((display-inline-images-local
         (lambda (beg end)
           (org-display-inline-images t t beg end)
           ;; display number of inline images which is intersection of two =
image overlays lists.
           ;; (message "%d images displayed inline"
           ;;          (length (cl-intersection org-inline-image-overlays (=
overlays-in beg end))))
           ))
        (hide-inline-images-local
         (lambda ()
           (setq org-inline-image-overlays nil) ; (org-remove-inline-images)
           (message "Inline image display turned off")))
        (inline-image-width-override ; get headline property value as inlin=
e image width.
         (lambda ()
           ;; The property "INLINE-IMAGE-WIDTH" value should be integer.
           (let* ((property-value (ignore-errors (org-property-or-variable-=
value 'INLINE-IMAGE-WIDTH)))
                  (width-integer (or (and property-value
                                          (if (numberp property-value) prop=
erty-value (string-to-number property-value)))
                                     (- (/ (window-width (selected-window) =
t) 2) 100))))
             (setq-local org-image-actual-width width-integer)))))
    (pcase state
      ('children
       (save-excursion
         (save-restriction
           (org-narrow-to-subtree)
           ;; If has nested headlines, beg,end only from parent headline
           ;; to first child headline which reference to upper let-binding
           ;; `org-next-visible-heading'.
           (funcall display-inline-images-local (point-min) (progn (org-nex=
t-visible-heading 1) (point))))))
      ('subtree
       (save-excursion
         (save-restriction
           (org-narrow-to-subtree)
           (funcall inline-image-width-override)
           ;; If has nested headlines, also inline display images under all=
 sub-headlines.
           (funcall display-inline-images-local (point-min) (point-max)))))
      ('folded
       (funcall hide-inline-images-local)))))

(add-to-list 'org-default-properties "INLINE-IMAGE-WIDTH")

(add-hook 'org-cycle-hook #'org-display-subtree-with-inline-images)

(define-key org-mode-map (kbd "C-c C-x C-v") 'org-display-subtree-with-inli=
ne-images)
#+end_src

=2D-=20

[ stardiviner ]
I try to make every word tell the meaning that I want to express without mi=
sunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAmMdRyAACgkQG13xyVro
msMKjwf/Qpe5zz2NuJDSRZo2UwjiEl9kqpjNXmIos3Wgou2Krq++Zz+uyhVfTZV/
8h/hsVyMIssbS8anf2kJenteI47VwfrEgb/gUvyf33A3uEpSnMfv9V/6zXvFNreh
Mu0c7pfzONTXJIeQ5cheJK+MIwXAgRHASPXd3UnneaLZohTHEWPoEL1Nq9/SKlBQ
+OblFUTqygd4AAjDacBX1+shmG7IKRPniEj2UE8WtfWAne2+BExUipHNEzlXZj6Z
sDtxANkKjlzM/MNfG4Y0ZC8Pp6ciDhcLSMdzuT3ne/oni4GbS0aXVTFSz4Wo3wrp
UZEcY2cEz3pUbX4XDDkm8cHDTdFvyw==
=dp6G
-----END PGP SIGNATURE-----
--=-=-=--