Gnus development mailing list
 help / color / mirror / Atom feed
* The Gnus logo in the modeline is displayed with a non-transparent background
@ 2018-02-25 21:31 Adam Sjøgren
  2018-02-25 22:39 ` Andreas Schwab
  0 siblings, 1 reply; 19+ messages in thread
From: Adam Sjøgren @ 2018-02-25 21:31 UTC (permalink / raw)
  To: ding

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

This is an affront to God and Humankind:


[-- Attachment #2: non-transparent-gnus.png --]
[-- Type: image/png, Size: 2376 bytes --]

[-- Attachment #3: Type: text/plain, Size: 492 bytes --]


Before I start looking into this [again], has anyone worked on a
solution, half-, or almost-, or perhaps ¼-done?

I tried to fix it once, I think, by somehow changing the image used to
be the SVG-version of the logo (or some other format), but I guess I
never, either, got it working, or followed through.


  Best regards,

    Adam

-- 
 "It seems like the finals for "least helpful answer          Adam Sjøgren
  on a mailing list" are coming up again."               asjo@koldfront.dk

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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-02-25 21:31 The Gnus logo in the modeline is displayed with a non-transparent background Adam Sjøgren
@ 2018-02-25 22:39 ` Andreas Schwab
  2018-02-25 23:06   ` Adam Sjøgren
  2018-02-25 23:22   ` Mike Kupfer
  0 siblings, 2 replies; 19+ messages in thread
From: Andreas Schwab @ 2018-02-25 22:39 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: ding

On Feb 25 2018, asjo@koldfront.dk (Adam Sjøgren) wrote:

> Before I start looking into this [again], has anyone worked on a
> solution, half-, or almost-, or perhaps ¼-done?

Worksforme (with Emacs 26.0.91).

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-02-25 22:39 ` Andreas Schwab
@ 2018-02-25 23:06   ` Adam Sjøgren
  2018-02-26  0:02     ` Eric Abrahamsen
  2018-02-26 19:22     ` Andreas Schwab
  2018-02-25 23:22   ` Mike Kupfer
  1 sibling, 2 replies; 19+ messages in thread
From: Adam Sjøgren @ 2018-02-25 23:06 UTC (permalink / raw)
  To: ding

Andreas writes:

> On Feb 25 2018, asjo@koldfront.dk (Adam Sjøgren) wrote:

> Worksforme (with Emacs 26.0.91).

Hm?! What is the background color of your modeline?

I have (from M-x describe-face mode-line):

       Foreground: black
       Background: grey86

I'm using GNU Emacs 27.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version
3.22.28) of 2018-02-25 built this evening (and don't remember not seing
this "problem").


  Best regards,

    Adam

-- 
  (Pithy optimistic saying goes here. Remember to edit        Adam Sjøgren
  this line!)                                            asjo@koldfront.dk




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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-02-25 22:39 ` Andreas Schwab
  2018-02-25 23:06   ` Adam Sjøgren
@ 2018-02-25 23:22   ` Mike Kupfer
  1 sibling, 0 replies; 19+ messages in thread
From: Mike Kupfer @ 2018-02-25 23:22 UTC (permalink / raw)
  To: Andreas Schwab, Adam Sjøgren; +Cc: ding

Andreas Schwab wrote:

> On Feb 25 2018, asjo@koldfront.dk (Adam Sjøgren) wrote:
> 
> > Before I start looking into this [again], has anyone worked on a
> > solution, half-, or almost-, or perhaps ¼-done?
> 
> Worksforme (with Emacs 26.0.91).

Me, too: Emacs 26.0.91 and 27.0.50 (changeset cdb3bda532).

I remember exchanging emails with Adam about this in the past.  I found
one message from that conversation (January 2016, subject "*Group* mode
line"), but the message doesn't include the resolution, and I can't
remember what the answer was.  Maybe it was something about the format
of the file that Emacs is pulling the logo from (e.g., xpm versus xbm)?

Or maybe there was something about the way Gnus constructs the modeline?
MH-E also includes a tiny logo in the modeline, and I have this vague
memory that MH-E does it differently than Gnus.  But looking at
#'gnus-mode-line-buffer-identification and #'mh-logo-display, the image
handling looks pretty similar.

mike



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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-02-25 23:06   ` Adam Sjøgren
@ 2018-02-26  0:02     ` Eric Abrahamsen
  2018-02-26 19:59       ` Adam Sjøgren
  2018-02-26 19:22     ` Andreas Schwab
  1 sibling, 1 reply; 19+ messages in thread
From: Eric Abrahamsen @ 2018-02-26  0:02 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> Andreas writes:
>
>> On Feb 25 2018, asjo@koldfront.dk (Adam Sjøgren) wrote:
>
>> Worksforme (with Emacs 26.0.91).
>
> Hm?! What is the background color of your modeline?
>
> I have (from M-x describe-face mode-line):
>
>        Foreground: black
>        Background: grey86
>
> I'm using GNU Emacs 27.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version
> 3.22.28) of 2018-02-25 built this evening (and don't remember not seing
> this "problem").

I'm using GNU Emacs 27.0.50 (build 36, x86_64-pc-linux-gnu, GTK+ Version
3.22.28) of 2018-02-23, and the image has a transparent background.

I assume I'm loading gnus-pointer.xpm (as opposed to *.xbm). My
mode-line background defaults to grey75, but I set to other values and
the transparent background behaved properly. Opening gnus-pointer.xpm in
Geeqie correctly displayed it as having a transparent background.

I know that's not helpful, but...

Eric



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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-02-25 23:06   ` Adam Sjøgren
  2018-02-26  0:02     ` Eric Abrahamsen
@ 2018-02-26 19:22     ` Andreas Schwab
  2018-02-26 19:31       ` Adam Sjøgren
  1 sibling, 1 reply; 19+ messages in thread
From: Andreas Schwab @ 2018-02-26 19:22 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: ding

On Feb 26 2018, asjo@koldfront.dk (Adam Sjøgren) wrote:

> I'm using GNU Emacs 27.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version
> 3.22.28) of 2018-02-25 built this evening (and don't remember not seing
> this "problem").

Do you have ImageMagick support?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-02-26 19:22     ` Andreas Schwab
@ 2018-02-26 19:31       ` Adam Sjøgren
  0 siblings, 0 replies; 19+ messages in thread
From: Adam Sjøgren @ 2018-02-26 19:31 UTC (permalink / raw)
  To: ding

Andreas writes:

> On Feb 26 2018, asjo@koldfront.dk (Adam Sjøgren) wrote:
>
>> I'm using GNU Emacs 27.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version
>> 3.22.28) of 2018-02-25 built this evening (and don't remember not seing
>> this "problem").

> Do you have ImageMagick support?

I think I do, I can see images inline in articles, and:

  $ ldd /usr/src/emacs/src/emacs | ag magick
          libMagickWand-6.Q16.so.5 => /usr/lib/x86_64-linux-gnu/libMagickWand-6.Q16.so.5 (0x00007f2de0e5f000)
          libMagickCore-6.Q16.so.5 => /usr/lib/x86_64-linux-gnu/libMagickCore-6.Q16.so.5 (0x00007f2de0991000)


  Best regards,

    Adam

-- 
 "I mean, what a disappointing 21st century this has          Adam Sjøgren
  been so far, you know?"                                asjo@koldfront.dk




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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-02-26  0:02     ` Eric Abrahamsen
@ 2018-02-26 19:59       ` Adam Sjøgren
  2018-02-26 20:18         ` Eric Abrahamsen
  0 siblings, 1 reply; 19+ messages in thread
From: Adam Sjøgren @ 2018-02-26 19:59 UTC (permalink / raw)
  To: ding

Ah! Found the reason!

When I got a "HiDPI" screen for the first time, Katsumi helped me with
these two defadvice, to scale images:

  (defadvice create-image (after scale-image-size activate)
    "Scale the image size."
    (condition-case nil
        (let* ((magnitude (frame-parameter nil 'image-dpi-scale-magnitude))
               (image (copy-sequence ad-return-value))
               (size (image-size image t))
               (spec (cdr image))
               (image-width (or (plist-get spec :width) (car size)))
               (image-height (or (plist-get spec :height) (cdr size))))
          (plist-put spec :width (round (* image-width magnitude)))
          (plist-put spec :height (round (* image-height magnitude)))
          (plist-put spec :type 'imagemagick)
          (setq ad-return-value image))
      (error nil)))

  (defadvice find-image (after scale-image-size activate)
    "Scale the image size."
    (condition-case nil
        (let* ((magnitude (frame-parameter nil 'image-dpi-scale-magnitude))
               (image (copy-sequence ad-return-value))
               (size (image-size image t))
               (spec (cdr image))
               (image-width (or (plist-get spec :width) (car size)))
               (image-height (or (plist-get spec :height) (cdr size))))
          (plist-put spec :width (round (* image-width magnitude)))
          (plist-put spec :height (round (* image-height magnitude)))
          (plist-put spec :type 'imagemagick)
          (setq ad-return-value image))
      (error nil)))

If I remove those (all images are too small, but) the image in the
modeline is transparent!

So another self-inflicted wound...


  Best regards,

    Adam

-- 
 "Mr. Cotton's... parrot. Same question."                     Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-02-26 19:59       ` Adam Sjøgren
@ 2018-02-26 20:18         ` Eric Abrahamsen
  2018-03-24 22:38           ` Adam Sjøgren
  0 siblings, 1 reply; 19+ messages in thread
From: Eric Abrahamsen @ 2018-02-26 20:18 UTC (permalink / raw)
  To: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> Ah! Found the reason!
>
> When I got a "HiDPI" screen for the first time, Katsumi helped me with
> these two defadvice, to scale images:
>
>   (defadvice create-image (after scale-image-size activate)
>     "Scale the image size."
>     (condition-case nil
>         (let* ((magnitude (frame-parameter nil 'image-dpi-scale-magnitude))
>                (image (copy-sequence ad-return-value))
>                (size (image-size image t))
>                (spec (cdr image))
>                (image-width (or (plist-get spec :width) (car size)))
>                (image-height (or (plist-get spec :height) (cdr size))))
>           (plist-put spec :width (round (* image-width magnitude)))
>           (plist-put spec :height (round (* image-height magnitude)))
>           (plist-put spec :type 'imagemagick)
>           (setq ad-return-value image))
>       (error nil)))
>
>   (defadvice find-image (after scale-image-size activate)
>     "Scale the image size."
>     (condition-case nil
>         (let* ((magnitude (frame-parameter nil 'image-dpi-scale-magnitude))
>                (image (copy-sequence ad-return-value))
>                (size (image-size image t))
>                (spec (cdr image))
>                (image-width (or (plist-get spec :width) (car size)))
>                (image-height (or (plist-get spec :height) (cdr size))))
>           (plist-put spec :width (round (* image-width magnitude)))
>           (plist-put spec :height (round (* image-height magnitude)))
>           (plist-put spec :type 'imagemagick)
>           (setq ad-return-value image))
>       (error nil)))
>
> If I remove those (all images are too small, but) the image in the
> modeline is transparent!

Huh, now that you mention it, I see all the images are too small on my
(hdpi) monitor, too. Oh well, at least they're transparent!

I wonder if you could play with that `find-image' advice and make it
work. Isn't 'imagemagick an odd :type for the image found? I wonder if
that's necessary to make the re-scaling work correctly. What happens if
you hard-code it to 'xpm, just for this case?

Eric




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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-02-26 20:18         ` Eric Abrahamsen
@ 2018-03-24 22:38           ` Adam Sjøgren
  2018-03-29  8:12             ` Eric Abrahamsen
  0 siblings, 1 reply; 19+ messages in thread
From: Adam Sjøgren @ 2018-03-24 22:38 UTC (permalink / raw)
  To: ding

Eric writes:

> Huh, now that you mention it, I see all the images are too small on my
> (hdpi) monitor, too. Oh well, at least they're transparent!

The only place the advice don't work is in the modeline, for me :-)

> I wonder if you could play with that `find-image' advice and make it
> work. Isn't 'imagemagick an odd :type for the image found?

I think that is the type you use when you want to be able to scale the
image...

> I wonder if that's necessary to make the re-scaling work correctly.
> What happens if you hard-code it to 'xpm, just for this case?

Good question, I can see that
/usr/src/emacs/etc/images/gnus/gnus-pointer.xpm is the file loaded.
Maybe I should just try skipping the advice for that file.

 find-image image before: (image :type xpm :file /usr/src/emacs/etc/images/gnus/gnus-pointer.xpm :ascent center)
 find-image spec after:         (:type imagemagick :file /usr/src/emacs/etc/images/gnus/gnus-pointer.xpm :ascent center :width 27 :height 20)

Modifying the advice thus gives the expected result:

  (defadvice find-image (after scale-image-size activate)
    "Scale the image size."
    (condition-case nil
        (let* ((magnitude (frame-parameter nil 'image-dpi-scale-magnitude))
               (image (copy-sequence ad-return-value))
               (size (image-size image t))
               (spec (cdr image))
               (image-width (or (plist-get spec :width) (car size)))
               (image-height (or (plist-get spec :height) (cdr size))))
          (when (not (string= (plist-get spec :type) "xpm")) ; skip xpm files, such as emacs/etc/images/gnus/gnus-pointer.xpm
            (plist-put spec :width (round (* image-width magnitude)))
            (plist-put spec :height (round (* image-height magnitude)))
            (plist-put spec :type 'imagemagick))
          (setq ad-return-value image))
      (error nil)))


  Best regards,

    Adam

-- 
 "Vi sitter i samma bil                                       Adam Sjøgren
  En silvergrå missil                                    asjo@koldfront.dk
  En bomb i motsatt fil
  Vi sitter i samma bil"




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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-03-24 22:38           ` Adam Sjøgren
@ 2018-03-29  8:12             ` Eric Abrahamsen
  2018-03-29 11:49               ` Adam Sjøgren
  0 siblings, 1 reply; 19+ messages in thread
From: Eric Abrahamsen @ 2018-03-29  8:12 UTC (permalink / raw)
  To: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> Eric writes:
>
>> Huh, now that you mention it, I see all the images are too small on my
>> (hdpi) monitor, too. Oh well, at least they're transparent!
>
> The only place the advice don't work is in the modeline, for me :-)

Do you mean that the advice works differently in the modeline versus
other places in Emacs? Or that it works differently in Gnus than in
other places in Emacs?

Mind you, I don't really know anything about image display in Emacs, I
was just following the rabbit hole. I wonder if we'll get support for
the new version of Imagemagick any time soon...




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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-03-29  8:12             ` Eric Abrahamsen
@ 2018-03-29 11:49               ` Adam Sjøgren
  2018-03-29 12:09                 ` Robert Pluim
  0 siblings, 1 reply; 19+ messages in thread
From: Adam Sjøgren @ 2018-03-29 11:49 UTC (permalink / raw)
  To: ding

Eric writes:

>> The only place the advice don't work is in the modeline, for me :-)

> Do you mean that the advice works differently in the modeline versus
> other places in Emacs?

Well. It would have been more precise if I had said that the modeline
was the only place I observed the advice to have an adverse effect.

If I load the SVG logo in the modeline, the modeline becomes HUGE,
instead of just scaling the SVG to fix the modeline (and the background
isn't transparent).

It may very well be that transparency doesn't work with the advice in
buffers as well, but my background there happens to be white, and the
images I see rarely have transparency, so I wouldn't notice.

> Or that it works differently in Gnus than in other places in Emacs?

I'm pretty sure it is the same, but I don't really use images outside of
Gnus.

> Mind you, I don't really know anything about image display in Emacs, I
> was just following the rabbit hole.

Me neither, I was just experimenting.

> I wonder if we'll get support for the new version of Imagemagick any
> time soon...

There's a new version?


  :-),

   Adam

-- 
 "But after all, who is? At least in our case - no one        Adam Sjøgren
  is such a great musician. But we are stubborn."        asjo@koldfront.dk




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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-03-29 11:49               ` Adam Sjøgren
@ 2018-03-29 12:09                 ` Robert Pluim
  2018-03-29 12:31                   ` Adam Sjøgren
  0 siblings, 1 reply; 19+ messages in thread
From: Robert Pluim @ 2018-03-29 12:09 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> Eric writes:
>
>>> The only place the advice don't work is in the modeline, for me :-)
>
>> Do you mean that the advice works differently in the modeline versus
>> other places in Emacs?
>
> Well. It would have been more precise if I had said that the modeline
> was the only place I observed the advice to have an adverse effect.
>
> If I load the SVG logo in the modeline, the modeline becomes HUGE,
> instead of just scaling the SVG to fix the modeline (and the background
> isn't transparent).
>
> It may very well be that transparency doesn't work with the advice in
> buffers as well, but my background there happens to be white, and the
> images I see rarely have transparency, so I wouldn't notice.
>
>> Or that it works differently in Gnus than in other places in Emacs?
>
> I'm pretty sure it is the same, but I don't really use images outside of
> Gnus.

Would you have a small self-contained example of images appearing too
big in Emacs? Iʼve fixed a number of scaling issues in Emacs, but more
always seem to pop up (Which version of Emacs is this, BTW?)

Thanks



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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-03-29 12:09                 ` Robert Pluim
@ 2018-03-29 12:31                   ` Adam Sjøgren
  2018-03-29 14:04                     ` Robert Pluim
  0 siblings, 1 reply; 19+ messages in thread
From: Adam Sjøgren @ 2018-03-29 12:31 UTC (permalink / raw)
  To: ding

Robert writes:

> Would you have a small self-contained example of images appearing too
> big in Emacs?

No, it works pretty well these days.

The advice I am using on find/create-image¹ is fixing the opposite
problem: images being too small on HiDPI screens.

The only problem with it was the tiny Gnus-logo in the modeline, which
has its transparent background turned white, when the :type is changed
from 'xpm to 'imagemagick (by the advice).

> Iʼve fixed a number of scaling issues in Emacs, but more always seem
> to pop up (Which version of Emacs is this, BTW?)

Cool, thanks! What kind of issues should I keep an eye out for? (I'm
currently running master at a140513acb).


  Best regards,

    Adam


¹ This is the current incarnation I use to get images scaled up on HiDPI
displays:

  (defadvice find-image (after scale-image-size activate)
    "Scale the image size."
    (condition-case nil
        (let* ((magnitude (frame-parameter nil 'image-dpi-scale-magnitude))
               (image (copy-sequence ad-return-value))
               (size (image-size image t))
               (spec (cdr image))
               (image-width (or (plist-get spec :width) (car size)))
               (image-height (or (plist-get spec :height) (cdr size))))
          (plist-put spec :width (round (* image-width magnitude)))
          (plist-put spec :height (round (* image-height magnitude)))
          (when (not (string= (plist-get spec :type) "xpm")) ; skip xpm files, such as emacs/etc/images/gnus/gnus-pointer.xpm
            (plist-put spec :type 'imagemagick))
          (setq ad-return-value image))
      (error nil)))

where image-dpi-scale-magnitude is set to 150 on HiDPI displays and 100
on non-HiDPI.

-- 
 "Om man köper ett gäng bananer och tar dom med hem..."       Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-03-29 12:31                   ` Adam Sjøgren
@ 2018-03-29 14:04                     ` Robert Pluim
  2018-03-29 14:17                       ` Adam Sjøgren
  0 siblings, 1 reply; 19+ messages in thread
From: Robert Pluim @ 2018-03-29 14:04 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> The advice I am using on find/create-image¹ is fixing the opposite
> problem: images being too small on HiDPI screens.

Too small and too big are symptoms of the same problem: not applying
the scaling factor correctly :-)

> The only problem with it was the tiny Gnus-logo in the modeline, which
> has its transparent background turned white, when the :type is changed
> from 'xpm to 'imagemagick (by the advice).
>
>> Iʼve fixed a number of scaling issues in Emacs, but more always seem
>> to pop up (Which version of Emacs is this, BTW?)
>
> Cool, thanks! What kind of issues should I keep an eye out for? (I'm
> currently running master at a140513acb).

That commit has all the current fixes.  Frame positioning, menu
positioning and font scaling should all be ok, except there are known
issues with the interaction between menus and scaling.

> ¹ This is the current incarnation I use to get images scaled up on HiDPI
> displays:
>
>   (defadvice find-image (after scale-image-size activate)
>     "Scale the image size."
>     (condition-case nil
>         (let* ((magnitude (frame-parameter nil 'image-dpi-scale-magnitude))
>                (image (copy-sequence ad-return-value))
>                (size (image-size image t))
>                (spec (cdr image))
>                (image-width (or (plist-get spec :width) (car size)))
>                (image-height (or (plist-get spec :height) (cdr size))))
>           (plist-put spec :width (round (* image-width magnitude)))
>           (plist-put spec :height (round (* image-height magnitude)))
>           (when (not (string= (plist-get spec :type) "xpm")) ; skip xpm files, such as emacs/etc/images/gnus/gnus-pointer.xpm
>             (plist-put spec :type 'imagemagick))
>           (setq ad-return-value image))
>       (error nil)))
>
> where image-dpi-scale-magnitude is set to 150 on HiDPI displays and 100
> on non-HiDPI.

150?! That seems very high. Iʼd expect values like 1.5 or 2.

Perhaps image-size is not scaling correctly, Iʼll see if I can find anything.

Robert



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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-03-29 14:04                     ` Robert Pluim
@ 2018-03-29 14:17                       ` Adam Sjøgren
  2018-03-29 16:19                         ` Robert Pluim
  0 siblings, 1 reply; 19+ messages in thread
From: Adam Sjøgren @ 2018-03-29 14:17 UTC (permalink / raw)
  To: ding

Robert writes:

>> The advice I am using on find/create-image¹ is fixing the opposite
>> problem: images being too small on HiDPI screens.

> Too small and too big are symptoms of the same problem: not applying
> the scaling factor correctly :-)

Are we talking about the same thing?

On a HiDPI display I want all images shown at 1.5x the normal ("pixel")
size.

Is Emacs supposed to do this automatically? (For images in buffers, i.e.
displayed by Gnus, eww or similar.)

>> where image-dpi-scale-magnitude is set to 150 on HiDPI displays and 100
>> on non-HiDPI.

> 150?! That seems very high. Iʼd expect values like 1.5 or 2.

Ah, sorry, my code is kind of messy and I read it wrong. The 150 gets
translated to 1.5. Sorry about that.


  Best regards,

    Adam

-- 
 "It's been a long, slow collision"                           Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-03-29 14:17                       ` Adam Sjøgren
@ 2018-03-29 16:19                         ` Robert Pluim
  2018-03-29 16:43                           ` Adam Sjøgren
  0 siblings, 1 reply; 19+ messages in thread
From: Robert Pluim @ 2018-03-29 16:19 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> Robert writes:
>
>>> The advice I am using on find/create-image¹ is fixing the opposite
>>> problem: images being too small on HiDPI screens.
>
>> Too small and too big are symptoms of the same problem: not applying
>> the scaling factor correctly :-)
>
> Are we talking about the same thing?
>
> On a HiDPI display I want all images shown at 1.5x the normal ("pixel")
> size.
>
> Is Emacs supposed to do this automatically? (For images in buffers, i.e.
> displayed by Gnus, eww or similar.)

Yes. Emacs queries the toolkit for the underlying scale factor (on
GNU/Linux + GTK at least), and is then supposed to use it when
displaying stuff.

>>> where image-dpi-scale-magnitude is set to 150 on HiDPI displays and 100
>>> on non-HiDPI.
>
>> 150?! That seems very high. Iʼd expect values like 1.5 or 2.
>
> Ah, sorry, my code is kind of messy and I read it wrong. The 150 gets
> translated to 1.5. Sorry about that.

No worries. Iʼm not sure fractional values work correctly, but thatʼs
not entirely an Emacs problem.

Robert



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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-03-29 16:19                         ` Robert Pluim
@ 2018-03-29 16:43                           ` Adam Sjøgren
  2018-03-30  7:39                             ` Robert Pluim
  0 siblings, 1 reply; 19+ messages in thread
From: Adam Sjøgren @ 2018-03-29 16:43 UTC (permalink / raw)
  To: ding

Robert writes:

> Yes. Emacs queries the toolkit for the underlying scale factor (on
> GNU/Linux + GTK at least), and is then supposed to use it when
> displaying stuff.

Ah, ok, it definitely doesn't to that for me.

Here is a simple test/comparison of what Emacs does by default and what
happens when I have my advice activated:

 $ emacs --no-init-file pics/sad_npm_kitty.png:

   · http://koldfront.dk/misc/gnu-emacs/image-scaling-default.png

 $ emacs pics/sad_npm_kitty.png

   · http://koldfront.dk/misc/gnu-emacs/image-scaling-advice.png

I may not have GTK set up "correctly", though (I use XMonad and none of
GNOME); this is what I wrote down to remember what I did:

 · https://koldfront.dk/archive/2017/08/13-133749.html
 · https://koldfront.dk/archive/2015/10/04-143310.html

Let me know if there is anything I should check/report.


  Best regards,

    Adam

-- 
 "I'm always interested in avoiding learning new              Adam Sjøgren
  things."                                               asjo@koldfront.dk




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

* Re: The Gnus logo in the modeline is displayed with a non-transparent background
  2018-03-29 16:43                           ` Adam Sjøgren
@ 2018-03-30  7:39                             ` Robert Pluim
  0 siblings, 0 replies; 19+ messages in thread
From: Robert Pluim @ 2018-03-30  7:39 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> Robert writes:
>
>> Yes. Emacs queries the toolkit for the underlying scale factor (on
>> GNU/Linux + GTK at least), and is then supposed to use it when
>> displaying stuff.
>
> Ah, ok, it definitely doesn't to that for me.

And I was wrong here. For displaying images Emacs works out the
scaling factor by looking at the font-width.

> Here is a simple test/comparison of what Emacs does by default and what
> happens when I have my advice activated:
>
>  $ emacs --no-init-file pics/sad_npm_kitty.png:
>
>    · http://koldfront.dk/misc/gnu-emacs/image-scaling-default.png
>
>  $ emacs pics/sad_npm_kitty.png
>
>    · http://koldfront.dk/misc/gnu-emacs/image-scaling-advice.png
>
> I may not have GTK set up "correctly", though (I use XMonad and none of
> GNOME); this is what I wrote down to remember what I did:
>
>  · https://koldfront.dk/archive/2017/08/13-133749.html
>  · https://koldfront.dk/archive/2015/10/04-143310.html
>
> Let me know if there is anything I should check/report.

The scaling calculation done by the emacs image code looks correct,
but the resulting image is too small when inserted on a HiDPI
screen. In fact, looks like emacs is ignoring the scale factor
completely even on when using a normal screen.

Robert



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

end of thread, other threads:[~2018-03-30  7:39 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-25 21:31 The Gnus logo in the modeline is displayed with a non-transparent background Adam Sjøgren
2018-02-25 22:39 ` Andreas Schwab
2018-02-25 23:06   ` Adam Sjøgren
2018-02-26  0:02     ` Eric Abrahamsen
2018-02-26 19:59       ` Adam Sjøgren
2018-02-26 20:18         ` Eric Abrahamsen
2018-03-24 22:38           ` Adam Sjøgren
2018-03-29  8:12             ` Eric Abrahamsen
2018-03-29 11:49               ` Adam Sjøgren
2018-03-29 12:09                 ` Robert Pluim
2018-03-29 12:31                   ` Adam Sjøgren
2018-03-29 14:04                     ` Robert Pluim
2018-03-29 14:17                       ` Adam Sjøgren
2018-03-29 16:19                         ` Robert Pluim
2018-03-29 16:43                           ` Adam Sjøgren
2018-03-30  7:39                             ` Robert Pluim
2018-02-26 19:22     ` Andreas Schwab
2018-02-26 19:31       ` Adam Sjøgren
2018-02-25 23:22   ` Mike Kupfer

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 NNTP newsgroup(s).