unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25863: 25.1; garbage display by small image
@ 2017-02-24 15:39 ynyaaa
  2017-02-24 18:20 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: ynyaaa @ 2017-02-24 15:39 UTC (permalink / raw)
  To: 25863


Evaluating the form below, the lower part of 'g' shape
remains to be displayed.

(progn
  (switch-to-buffer (generate-new-buffer "temp"))
  (insert-image (create-image (concat "P4\n8 22\n" (make-string 22 127))
                              'pbm t))
  (insert ?g)
  (redisplay)
  (delete-char -1))




In GNU Emacs 25.1.1 (i686-w64-mingw32)
 of 2016-09-18 built on LAPHROAIG
Windowing system distributor 'Microsoft Corp.', version 6.0.6002
Configured using:
 'configure --host=i686-w64-mingw32 --without-dbus
 --without-compress-install CFLAGS=-static'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS

Important settings:
  value of $LANG: JPN
  locale-coding-system: cp932

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:

Load-path shadows:
None found.

Features:
(novice network-stream nsm starttls tls gnutls mailalias smtpmail
auth-source cl-seq eieio byte-opt bytecomp byte-compile cl-extra cconv
eieio-core cl-macs gv pp shadow sort mail-extr emacsbug message dired
format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns
help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr mail-utils
time-date mule-util japan-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table
w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote w32notify w32 multi-tty
make-network-process emacs)

Memory information:
((conses 8 107526 23155)
 (symbols 32 21046 0)
 (miscs 32 95 243)
 (strings 16 20052 5589)
 (string-bytes 1 577364)
 (vectors 8 15163)
 (vector-slots 4 542778 17060)
 (floats 8 199 312)
 (intervals 28 914 6)
 (buffers 520 23))





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25863: 25.1; garbage display by small image
  2017-02-24 15:39 bug#25863: 25.1; garbage display by small image ynyaaa
@ 2017-02-24 18:20 ` Eli Zaretskii
  2017-02-25  8:48   ` ynyaaa
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2017-02-24 18:20 UTC (permalink / raw)
  To: ynyaaa; +Cc: 25863

> From: ynyaaa@gmail.com
> Date: Sat, 25 Feb 2017 00:39:15 +0900
> 
> Evaluating the form below, the lower part of 'g' shape
> remains to be displayed.
> 
> (progn
>   (switch-to-buffer (generate-new-buffer "temp"))
>   (insert-image (create-image (concat "P4\n8 22\n" (make-string 22 127))
>                               'pbm t))
>   (insert ?g)
>   (redisplay)
>   (delete-char -1))

Not reproducible here.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25863: 25.1; garbage display by small image
  2017-02-24 18:20 ` Eli Zaretskii
@ 2017-02-25  8:48   ` ynyaaa
  2017-02-25  9:06     ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: ynyaaa @ 2017-02-25  8:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25863

Eli Zaretskii <eliz@gnu.org> writes:
>> Evaluating the form below, the lower part of 'g' shape
>> remains to be displayed.
>> 
>> (progn
>>   (switch-to-buffer (generate-new-buffer "temp"))
>>   (insert-image (create-image (concat "P4\n8 22\n" (make-string 22 127))
>>                               'pbm t))
>>   (insert ?g)
>>   (redisplay)
>>   (delete-char -1))
>
> Not reproducible here.

Reducing the height of the image or enlarging the font may show garbages.
Otherwise I have no idea.

With emacs -Q, the font used is
"-outline-Courier New-normal-normal-normal-mono-20-*-*-*-c-*-iso8859-1".
In this case, garbages are shown with images of height from 11 to 22.

Setting the font to
"-outline-Courier New-normal-normal-normal-mono-16-*-*-*-c-*-iso8859-1".
In this case, garbages are shown with images of height from 9 to 18.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25863: 25.1; garbage display by small image
  2017-02-25  8:48   ` ynyaaa
@ 2017-02-25  9:06     ` Eli Zaretskii
  2017-02-25 10:11       ` ynyaaa
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2017-02-25  9:06 UTC (permalink / raw)
  To: ynyaaa; +Cc: 25863

> From: ynyaaa@gmail.com
> Cc: 25863@debbugs.gnu.org
> Date: Sat, 25 Feb 2017 17:48:40 +0900
> 
> >> (progn
> >>   (switch-to-buffer (generate-new-buffer "temp"))
> >>   (insert-image (create-image (concat "P4\n8 22\n" (make-string 22 127))
> >>                               'pbm t))
> >>   (insert ?g)
> >>   (redisplay)
> >>   (delete-char -1))
> >
> > Not reproducible here.
> 
> Reducing the height of the image or enlarging the font may show garbages.
> Otherwise I have no idea.
> 
> With emacs -Q, the font used is
> "-outline-Courier New-normal-normal-normal-mono-20-*-*-*-c-*-iso8859-1".
> In this case, garbages are shown with images of height from 11 to 22.
> 
> Setting the font to
> "-outline-Courier New-normal-normal-normal-mono-16-*-*-*-c-*-iso8859-1".
> In this case, garbages are shown with images of height from 9 to 18.

I'm not sure I understand how to change the test case to account for
the above.  Evaluating "(face-font 'default)" in "emacs -Q" produces
this:

  "-outline-Courier New-normal-normal-normal-mono-13-*-*-*-c-*-iso8859-1"

How to change the test case to reproduce the problem with this font,
please?





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25863: 25.1; garbage display by small image
  2017-02-25  9:06     ` Eli Zaretskii
@ 2017-02-25 10:11       ` ynyaaa
  2017-02-25 12:19         ` Eli Zaretskii
  2020-08-04  9:15         ` Lars Ingebrigtsen
  0 siblings, 2 replies; 10+ messages in thread
From: ynyaaa @ 2017-02-25 10:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25863

[-- Attachment #1: Type: text/plain, Size: 1051 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:
> I'm not sure I understand how to change the test case to account for
> the above.  Evaluating "(face-font 'default)" in "emacs -Q" produces
> this:
>
>   "-outline-Courier New-normal-normal-normal-mono-13-*-*-*-c-*-iso8859-1"
>
> How to change the test case to reproduce the problem with this font,
> please?

Starting emacs -Q and (set-frame-font
"-outline-Courier New-normal-normal-normal-mono-13-*-*-*-c-*-iso8859-1"),
the form below displayed garbage.
The value for 'h' may be modified between 9 and 16.

(let ((h 16))
  (switch-to-buffer (generate-new-buffer "temp"))
  (insert-image (create-image (concat (format "P4\n8 %d\n" h)
                                      (make-string h 127))
                              'pbm t))
  (insert ?g)
  (redisplay)
  (delete-char -1))

The attached image is the screen shot of the garbage display.
The left rectangle is the pbm image and the right rectangle
is text cursor, which looks shorter than the line height
where the line height equals to the image height.


[-- Attachment #2: test-emacs-garbage.png --]
[-- Type: image/png, Size: 2860 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25863: 25.1; garbage display by small image
  2017-02-25 10:11       ` ynyaaa
@ 2017-02-25 12:19         ` Eli Zaretskii
  2017-02-25 14:05           ` Eli Zaretskii
  2020-08-04  9:15         ` Lars Ingebrigtsen
  1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2017-02-25 12:19 UTC (permalink / raw)
  To: ynyaaa; +Cc: 25863

> From: ynyaaa@gmail.com
> Cc: 25863@debbugs.gnu.org
> Date: Sat, 25 Feb 2017 19:11:41 +0900
> 
> >   "-outline-Courier New-normal-normal-normal-mono-13-*-*-*-c-*-iso8859-1"
> >
> > How to change the test case to reproduce the problem with this font,
> > please?
> 
> Starting emacs -Q and (set-frame-font
> "-outline-Courier New-normal-normal-normal-mono-13-*-*-*-c-*-iso8859-1"),
> the form below displayed garbage.
> The value for 'h' may be modified between 9 and 16.
> 
> (let ((h 16))
>   (switch-to-buffer (generate-new-buffer "temp"))
>   (insert-image (create-image (concat (format "P4\n8 %d\n" h)
>                                       (make-string h 127))
>                               'pbm t))
>   (insert ?g)
>   (redisplay)
>   (delete-char -1))

Thanks, I see it now.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25863: 25.1; garbage display by small image
  2017-02-25 12:19         ` Eli Zaretskii
@ 2017-02-25 14:05           ` Eli Zaretskii
  2017-02-25 23:59             ` ynyaaa
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2017-02-25 14:05 UTC (permalink / raw)
  To: ynyaaa; +Cc: 25863

severity 25863 minor
thanks

> Date: Sat, 25 Feb 2017 14:19:19 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 25863@debbugs.gnu.org
> 
> > (let ((h 16))
> >   (switch-to-buffer (generate-new-buffer "temp"))
> >   (insert-image (create-image (concat (format "P4\n8 %d\n" h)
> >                                       (make-string h 127))
> >                               'pbm t))
> >   (insert ?g)
> >   (redisplay)
> >   (delete-char -1))
> 
> Thanks, I see it now.

Looks like a basic deficiency in the design of the Emacs redisplay,
and in particular the way screen lines are redrawn when they have
variable-height glyphs.

Fortunately, this is a fairly rare situation.  In the recipe above,
it's enough to make a very small change to make the problem go away:

(let ((h 16))
  (switch-to-buffer (generate-new-buffer "temp"))
  (insert "x")     ;; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  (insert-image (create-image (concat (format "P4\n8 %d\n" h)
                                      (make-string h 127))
                              'pbm t))
  (insert ?g)
  (redisplay)
  (delete-char -1))

Or maybe I'm missing something; ideas are welcome.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25863: 25.1; garbage display by small image
  2017-02-25 14:05           ` Eli Zaretskii
@ 2017-02-25 23:59             ` ynyaaa
  2017-02-26 15:38               ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: ynyaaa @ 2017-02-25 23:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25863

Eli Zaretskii <eliz@gnu.org> writes:
> Fortunately, this is a fairly rare situation.

I think it is not so rare.

Long ago, I noticed that a small dot may be displayed near an image
when viewing it by find-file.
For a long time I was not aware that it is a small part of a glyph
which is displayed before buffer switching.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25863: 25.1; garbage display by small image
  2017-02-25 23:59             ` ynyaaa
@ 2017-02-26 15:38               ` Eli Zaretskii
  0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2017-02-26 15:38 UTC (permalink / raw)
  To: ynyaaa; +Cc: 25863

> From: ynyaaa@gmail.com
> Cc: 25863@debbugs.gnu.org
> Date: Sun, 26 Feb 2017 08:59:14 +0900
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> > Fortunately, this is a fairly rare situation.
> 
> I think it is not so rare.
> 
> Long ago, I noticed that a small dot may be displayed near an image
> when viewing it by find-file.
> For a long time I was not aware that it is a small part of a glyph
> which is displayed before buffer switching.

It could be not so rare in your use patterns, but I was talking about
the average Emacs user out there.  The fact is we didn't (AFAIR) see
bug reports about such problems, and even reproducing this on my
machine needed some effort.  Which is not surprising, given the
particular relation between the default font size and the metrics and
position of the image needed to have the bug show itself.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25863: 25.1; garbage display by small image
  2017-02-25 10:11       ` ynyaaa
  2017-02-25 12:19         ` Eli Zaretskii
@ 2020-08-04  9:15         ` Lars Ingebrigtsen
  1 sibling, 0 replies; 10+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-04  9:15 UTC (permalink / raw)
  To: ynyaaa; +Cc: 25863

ynyaaa@gmail.com writes:

> (let ((h 16))
>   (switch-to-buffer (generate-new-buffer "temp"))
>   (insert-image (create-image (concat (format "P4\n8 %d\n" h)
>                                       (make-string h 127))
>                               'pbm t))
>   (insert ?g)
>   (redisplay)
>   (delete-char -1))

I can confirm that this bug is still present in Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-08-04  9:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-24 15:39 bug#25863: 25.1; garbage display by small image ynyaaa
2017-02-24 18:20 ` Eli Zaretskii
2017-02-25  8:48   ` ynyaaa
2017-02-25  9:06     ` Eli Zaretskii
2017-02-25 10:11       ` ynyaaa
2017-02-25 12:19         ` Eli Zaretskii
2017-02-25 14:05           ` Eli Zaretskii
2017-02-25 23:59             ` ynyaaa
2017-02-26 15:38               ` Eli Zaretskii
2020-08-04  9:15         ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).