GNU bug report logs - #22172
25.1.50; Wishlist: There should be a way to say to Emacs that is should rescale all images with a certain factor

Previous Next

Package: emacs;

Reported by: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Date: Mon, 14 Dec 2015 23:01:02 UTC

Severity: wishlist

Tags: fixed

Found in version 25.1.50

Fixed in version 26.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 22172 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 22172 <at> debbugs.gnu.org
Subject: Re: 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
Lars Ingebrigtsen <larsi <at> gnus.org> 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




This bug report was last modified 8 years and 171 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.