From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#22172: 25.1.50; Wishlist: There should be a way to say to Emacs that is should rescale all images with a certain factor Date: Mon, 08 Feb 2016 18:25:46 +1100 Message-ID: <87zivboe85.fsf@gnus.org> References: <87bn7rya7o.fsf@gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1454916445 21454 80.91.229.3 (8 Feb 2016 07:27:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Feb 2016 07:27:25 +0000 (UTC) To: 22172@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 08 08:27:14 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aSgE5-0003UC-Pm for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Feb 2016 08:27:13 +0100 Original-Received: from localhost ([::1]:42041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSgE5-0001An-9X for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Feb 2016 02:27:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSgDx-00014k-Lp for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2016 02:27:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSgDt-0005wd-Qw for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2016 02:27:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57553) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSgDt-0005wO-NG for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2016 02:27:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aSgDt-00087S-J1 for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2016 02:27:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Feb 2016 07:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22172 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22172-submit@debbugs.gnu.org id=B22172.145491639231170 (code B ref 22172); Mon, 08 Feb 2016 07:27:01 +0000 Original-Received: (at 22172) by debbugs.gnu.org; 8 Feb 2016 07:26:32 +0000 Original-Received: from localhost ([127.0.0.1]:37909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aSgDM-00086c-Lx for submit@debbugs.gnu.org; Mon, 08 Feb 2016 02:26:32 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:60016) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aSgDH-00086I-6n for 22172@debbugs.gnu.org; Mon, 08 Feb 2016 02:26:26 -0500 Original-Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aSgCk-0005Lc-9X for 22172@debbugs.gnu.org; Mon, 08 Feb 2016 08:25:50 +0100 In-Reply-To: <87bn7rya7o.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 08 Feb 2016 17:42:19 +1100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aSgCk-0005Lc-9X MailScanner-NULL-Check: 1455521151.01076@ifJohH+sLrQ6IjhP3GVzxQ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:112696 Archived-At: Lars Ingebrigtsen writes: > And the new variable is called image-scaling-factor. And this is now implemented, documented and pushed. Feel free to tweak the logic. :-) This defaults to 'auto, which means that it uses the dubious heuristic "a character on a 'normal' screen is 10 pixels wide". (defun image-compute-scaling-factor (scaling) (cond ((numberp image-scaling-factor) image-scaling-factor) ((eq image-scaling-factor 'auto) (let ((width (/ (float (window-width nil t)) (window-width)))) ;; If we assume that a typical character is 10 pixels in width, ;; then we should scale all images according to how wide they ;; are. But don't scale images down. (if (< width 10) 1 (/ (float width) 10)))) (t (error "Invalid scaling factor %s" image-scaling-factor)))) I don't have any statistics to back that up, though. Anybody have any feelings on the "10" thing? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no