GNU bug report logs - #52929
27.1; Images are sometimes not fully displayed

Previous Next

Package: emacs;

Reported by: Markus Triska <triska <at> metalevel.at>

Date: Sat, 1 Jan 2022 09:01:02 UTC

Severity: normal

Found in version 27.1

Done: Markus Triska <triska <at> metalevel.at>

Bug is archived. No further changes may be made.

Full log


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

From: martin rudalics <rudalics <at> gmx.at>
To: Markus Triska <triska <at> metalevel.at>
Cc: 52929 <at> debbugs.gnu.org
Subject: Re: bug#52929: 27.1; Images are sometimes not fully displayed
Date: Sat, 1 Jan 2022 17:01:27 +0100
>> Please try with adding a (no-special-glyphs . t) entry to the parameters
>> of the child frame.
>
> This solves the issue completely, thank you a lot for this! Could you
> please briefly explain why this is necessary to fully show the image? In
> particular, which glyph was shown here that used the 1 pixel width?

When a window has no right fringe, Emacs by default usurps the rightmost
character on each text line so it can indicate there whether that line
is truncated or continued.  The maximum width of the special glyph to be
displayed there (typically a "$" or a "\") is subtracted from the
maximum width of the display area of that window.  So with the right
fringe turned off, you as a rule always lose one column to the display
engine even when displayed lines are never truncated or continued.

But Eli can explain it better.

Note that with current master you need not calculate the size of your
image yourself.  Emacs can do it for you as with

(with-current-buffer (get-buffer-create "Happy New Year 2022!")
  (setq cursor-type nil mode-line-format nil)
  (erase-buffer)
  (insert-image-file "/home/martin/Downloads/202202.png")
  (let* ((size (buffer-text-pixel-size))
	 (width (car size))
	 (height (cdr size))
	 (frame (make-frame `((parent-frame . ,(selected-frame))
			      (no-special-glyphs . t)
			      (minibuffer . nil)
			      (left . 100)
			      (top . 100)
			      (internal-border-width . 0)
			      (vertical-scroll-bars . nil)
			      (left-fringe . 0)
			      (right-fringe . 0)
			      (width . (text-pixels . ,width))
			      (height . (text-pixels . ,height))))))
    (read-key)
    (delete-frame frame)))

With Emacs 27 you would have to use 'window-text-pixel-size' or
'fit-frame-to-buffer' which both have the problem that you first have to
put your buffer into a window in order to resize it appropriately.

martin




This bug report was last modified 3 years and 199 days ago.

Previous Next


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