From: Markus Triska <triska@metalevel.at>
To: 52929@debbugs.gnu.org
Subject: bug#52929: 27.1; Images are sometimes not fully displayed
Date: Sat, 01 Jan 2022 10:00:24 +0100 [thread overview]
Message-ID: <m24k6nhluf.fsf@metalevel.at> (raw)
Dear all,
to reproduce this issue, please download the following image:
https://www.metalevel.at/ei/202202.png
Then start Emacs with
$ emacs -Q
and evaluate the form that follows below.
Please note that the image has geometry 202x202. The form creates a
frame with this height and width. It uses a default face with height 1px
to allow pixel exact resizing of the frame. The snippet then waits for a
keypress, and then deletes the frame again.
The frame is large enough to display the image fully, including the thin
border that is drawn around the image. This can be seen by changing
"(setq cursor-type nil ..." to "(setq cursor-type t ..." in the snippet,
in which case the image is fully shown in the frame.
Yet, with the snippet as shown below, the thin border around the image
is not shown at the right margin of the image: You can see that the
frame appears fully white at the right, whereas all other margins of the
image (left, top and bottom) do display the very thin black border fully.
If the following line, which is commented out in the snippet, is
enabled, i.e., if the width is increased by exactly 1 pixel, then also
the thin border on the right is fully shown:
(set-frame-width frame (1+ width) nil t)
If possible, I would prefer Emacs to show the image fully also if its
exact dimensions (202x202) are used for the frame size. Is there a way
to do this?
Thank you a lot, and Happy New Year 2022!
Markus
(let* ((width 202)
(height 202)
(frame (make-frame `((parent-frame . ,(selected-frame))
(minibuffer . nil)
(left . 100)
(top . 100)
(internal-border-width . 0)
(vertical-scroll-bars . nil)
(left-fringe . 0)
(right-fringe . 0)
;; not setting the width/height causes
;; mode line flickering (see #52666)
(width . (text-pixels . ,width))
(height . (text-pixels . ,height))))))
;; set 1 pixel height default face, to allow pixel exact resizing
;; of the frame
(set-face-attribute 'default frame :height 10)
;; set the height and width again, since set-face-attribute
;; resizes the frame
(set-frame-width frame width nil t)
;; enable the following line to display the border fully
;; (set-frame-width frame (1+ width) nil t)
(set-frame-height frame height nil t)
(with-selected-frame frame
(switch-to-buffer (get-buffer-create "Happy New Year 2022!"))
(setq cursor-type nil
mode-line-format nil)
(erase-buffer)
(insert-image-file "202202.png"))
(read-key)
(delete-frame frame))
In GNU Emacs 27.1 (build 1, x86_64-apple-darwin15.3.0, X toolkit, Xaw scroll bars)
of 2020-12-12 built on macbook
Windowing system distributor 'The X.Org Foundation', version 11.0.11502000
System Description: Mac OS X 10.11.3
Configured using:
'configure --prefix=/opt/local --disable-silent-rules --without-ns
--without-dbus --without-gconf --without-libotf --without-m17n-flt
--with-gmp --with-gnutls --with-json --with-xml2 --with-modules
--infodir /opt/local/share/info/emacs --with-x-toolkit=lucid
--without-xaw3d --without-imagemagick --with-xpm --with-jpeg
--with-tiff --with-gif --with-png --with-lcms2 --without-rsvg
--with-xft 'CFLAGS=-pipe -Os -arch x86_64'
CPPFLAGS=-I/opt/local/include 'LDFLAGS=-L/opt/local/lib
-Wl,-headerpad_max_install_names -lfreetype -lfontconfig -Wl,-no_pie
-arch x86_64''
Configured features:
XPM JPEG TIFF GIF PNG GSETTINGS GLIB NOTIFY KQUEUE ACL GNUTLS LIBXML2
FREETYPE HARFBUZZ XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM
MODULES THREADS JSON PDUMPER LCMS2 GMP
next reply other threads:[~2022-01-01 9:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-01 9:00 Markus Triska [this message]
2022-01-01 10:06 ` bug#52929: 27.1; Images are sometimes not fully displayed martin rudalics
2022-01-01 10:11 ` Markus Triska
2022-01-01 16:01 ` martin rudalics
2022-01-01 16:17 ` Eli Zaretskii
2022-01-01 17:06 ` Markus Triska
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m24k6nhluf.fsf@metalevel.at \
--to=triska@metalevel.at \
--cc=52929@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.