bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22172: 25.1.50; Wishlist: There should be a way to say to Emacs that


From: Lars Ingebrigtsen
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Lars Ingebrigtsen <address@hidden> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]