Discussion:
piping html inline images through filter
Peter Münster
2015-10-13 20:16:25 UTC
Permalink
Hi,

How would it be possible to pipe html inline images through a filter
program please?

Use case: some people often send me messages with inline images that are
screenshots (GIF images with mostly text). When replying, I would like
to quote the text of the images.

Idea:
- display article in html mode
- call a washing function, that pipes all images through a filter
(OCR program, that converts images to text)
- then reply to the message and have all inline images quoted as text

How could I make such a washing function please? Or do you have better
ideas?

TIA for any help,
--
Peter
Enrico Schumann
2015-10-14 11:47:38 UTC
Permalink
Post by Peter Münster
Hi,
How would it be possible to pipe html inline images through a filter
program please?
Use case: some people often send me messages with inline images that are
screenshots (GIF images with mostly text). When replying, I would like
to quote the text of the images.
- display article in html mode
- call a washing function, that pipes all images through a filter
(OCR program, that converts images to text)
- then reply to the message and have all inline images quoted as text
How could I make such a washing function please? Or do you have better
ideas?
TIA for any help,
For processing specific parts of the email you could first save the
interesting parts to some tmp-directory (for instance with
'gnus-summary-save-parts'). Then run a 'shell-command' that does all the
computations on the image(s), the output of which you insert into your
reply.
--
Enrico Schumann
Lucerne, Switzerland
http://enricoschumann.net
Peter Münster
2015-10-14 17:42:47 UTC
Permalink
Post by Enrico Schumann
For processing specific parts of the email you could first save the
interesting parts to some tmp-directory (for instance with
'gnus-summary-save-parts'). Then run a 'shell-command' that does all the
computations on the image(s), the output of which you insert into your
reply.
Yes, thanks. And how would it be possible to place the output at the
right location please?

TIA,
--
Peter
Enrico Schumann
2015-10-15 14:26:33 UTC
Permalink
Post by Peter Münster
Post by Enrico Schumann
For processing specific parts of the email you could first save the
interesting parts to some tmp-directory (for instance with
'gnus-summary-save-parts'). Then run a 'shell-command' that does all the
computations on the image(s), the output of which you insert into your
reply.
Yes, thanks. And how would it be possible to place the output at the
right location please?
TIA,
I have no idea; sorry. [In my workflow, the script sends the emails,
without any interaction.]

In principle, you could to something like this from the Summary buffer

(defun reply-with-shell-output ()
(interactive)
;; save parts with gnus-summary-save-parts
(gnus-summary-reply-with-original 1)
;; move to correct place
(shell-command "date" t))

but it would require quite some manoeuvring/editing in the reply-buffer.
--
Enrico Schumann
Lucerne, Switzerland
http://enricoschumann.net
Loading...