Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Generate and insert Face header from jpg file
@ 2022-07-31  2:40 Satoshi Yoshida
  2022-07-31 10:15 ` Adam Sjøgren
  2022-08-01  2:29 ` Emanuel Berg
  0 siblings, 2 replies; 4+ messages in thread
From: Satoshi Yoshida @ 2022-07-31  2:40 UTC (permalink / raw)
  To: info-gnus-english

I use Gnus v5.13
I read https://www.gnus.org/manual/gnus_124.html#Face
and set in .gnus.el

(setq message-required-headers
      (nconc message-required-headers
             (list '(Face . (lambda ()
                              (gnus-face-from-file "~/face.jpg"))))))

But I couldn't generate and insert Face header at writing a mail.

I think there is no problem about ~/face.jpg (48x48 pixels, 13.2kB).
When I pasted Face header generated by shell script with face.jpg

http://quimby.gnus.org/circus/face/make-face
(I needed to rewrite "mimencode" to "mmencode" of FreeBSD package)

and send a mail myself, I could see Face image correctly.

Does anyone know the solutions?

-- 
Satoshi Yoshida


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

* Re: Generate and insert Face header from jpg file
  2022-07-31  2:40 Generate and insert Face header from jpg file Satoshi Yoshida
@ 2022-07-31 10:15 ` Adam Sjøgren
  2022-07-31 12:18   ` Satoshi Yoshida
  2022-08-01  2:29 ` Emanuel Berg
  1 sibling, 1 reply; 4+ messages in thread
From: Adam Sjøgren @ 2022-07-31 10:15 UTC (permalink / raw)
  To: info-gnus-english

Satoshi writes:

> (setq message-required-headers
>       (nconc message-required-headers
>              (list '(Face . (lambda ()
>                               (gnus-face-from-file "~/face.jpg"))))))
>
> But I couldn't generate and insert Face header at writing a mail.

What happens when you try? Do you get an error message?

You have chosen to use gnus-face-from-file and a JPEG - the
documentation says that it uses gnus-convert-image-to-face-command to
convert the image to PNG:

,----[ C-h v gnus-convert-image-to-face-command RET ]
| gnus-convert-image-to-face-command is a variable defined in ‘gnus-fun.el’.
| 
| Its value is "convert -scale 48x48! %s -colors %d png:-"
| 
| Command for converting an image to a Face.
| 
| The command must take an image filename (first format argument
| "%s") and the number of colors (second format argument: "%d")
| as input.  The output must be the Face header data on stdout in
| PNG format.
| 
`----

Do you have ImageMagick installed on your machine (i.e. the package that
contains the "convert" command)?

To eliminate that potential source of problems you could save the image
as a PNG and use gnus-convert-png-to-face instead.


  Best regards,

    Adam

-- 
 "perhaps he does not understand that business needs        Adam Sjøgren
  to be run without idiot balloons or child games."    asjo@koldfront.dk



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

* Re: Generate and insert Face header from jpg file
  2022-07-31 10:15 ` Adam Sjøgren
@ 2022-07-31 12:18   ` Satoshi Yoshida
  0 siblings, 0 replies; 4+ messages in thread
From: Satoshi Yoshida @ 2022-07-31 12:18 UTC (permalink / raw)
  To: info-gnus-english

Adam Sjøgren <asjo@koldfront.dk> writes:

> What happens when you try? Do you get an error message?

Nothing happened. Just I received test mail with no Face header.
I got no error message.

> You have chosen to use gnus-face-from-file and a JPEG - the
> documentation says that it uses gnus-convert-image-to-face-command to
> convert the image to PNG:
>
> ,----[ C-h v gnus-convert-image-to-face-command RET ]
> | gnus-convert-image-to-face-command is a variable defined in ‘gnus-fun.el’.
> | 
> | Its value is "convert -scale 48x48! %s -colors %d png:-"
> | 
> | Command for converting an image to a Face.
> | 
> | The command must take an image filename (first format argument
> | "%s") and the number of colors (second format argument: "%d")
> | as input.  The output must be the Face header data on stdout in
> | PNG format.
> | 
> `----
>
> Do you have ImageMagick installed on your machine (i.e. the package that
> contains the "convert" command)?

OK. I installed ImageMagick and confirmed "convert" command is valid.
I retried to send test mail and got time lag.
It is evidence that Gnus processed something.
Error mssage wasn't displayed.
But I received test mail with no Face header again.

> To eliminate that potential source of problems you could save the image
> as a PNG and use gnus-convert-png-to-face instead.

I see. I generated PNG file by GIMP because I am used to it.
And I set .gnus.el

(setq message-required-headers
      (nconc message-required-headers
             (list '(Face . (lambda ()
                              (gnus-convert-png-to-face "~/face.png"))))))

Finally I generated and inserted Face header succesfully.
Thank you very much.

-- 
Satoshi Yoshida


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

* Re: Generate and insert Face header from jpg file
  2022-07-31  2:40 Generate and insert Face header from jpg file Satoshi Yoshida
  2022-07-31 10:15 ` Adam Sjøgren
@ 2022-08-01  2:29 ` Emanuel Berg
  1 sibling, 0 replies; 4+ messages in thread
From: Emanuel Berg @ 2022-08-01  2:29 UTC (permalink / raw)
  To: info-gnus-english

Satoshi Yoshida wrote:

> (gnus-face-from-file "~/face.jpg")

Okay, sounds like an interesting function? :O

But `gnus-convert-image-to-face-command', mentioned in the
docstring, isn't defined here and has no docstring of its own
...

-- 
underground experts united
https://dataswamp.org/~incal



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

end of thread, other threads:[~2022-08-01  2:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-31  2:40 Generate and insert Face header from jpg file Satoshi Yoshida
2022-07-31 10:15 ` Adam Sjøgren
2022-07-31 12:18   ` Satoshi Yoshida
2022-08-01  2:29 ` Emanuel Berg

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).