Subject: Re: bug#71909: 30.0.60; yank-media on MS-Windows

From: Eli Zaretskii <[email-masked]>
Date: Thu, 24 Oct 2024 12:38:49 +0300

> Date: Thu, 24 Oct 2024 10:39:13 +0200
> From: Cecilio Pardo <[email-masked]>
> 
> On 24/10/2024 9:18, Eli Zaretskii wrote:
> 
> >> - If no PNG is offered, but DIBV5 is, like Firefox, convert the pixel
> >> data to a PNG file, and offer it as image/png. We don't loose anything
> >> converting the BMP to PNG, and the programs that use yank-media for
> >> images (message-mode, org-mode) need a file, not an in-memory image
> >> object. And PNG is a much better format.
> > 
> > I'm not sure I follow: isn't yank-media about yanking the image into
> > the current buffer?  If so, why is having a file important, let alone
> > necessary?
> 
> I mean they need data in the format that would go into a file, PNG, BMP, 
> etc. Not the kind of data that is a DIB. We could easily convert in to a 
> BMP file, but, once we need to manipulate it, better to give a PNG.

Maybe we need an image-save-as function, to save an image's data to a
file, then?  What you describe sounds like a separate requirement.

> org-mode stores the yanked images as attachments, saving files. 
> message-mode stores the images in the message like this:
> 
> <#part type="image/png" disposition=inline data-encoding=base64 raw=t>
> iVBORw0KGgoAA...
> 
> That is, not a file in disk, but the data that would go into a PNG file.

If a file is needed, writing the image data to a file will solve it
(and is a useful feature to have, regardless).

Does yank-media produce image files on GNU/Linux, when it yanks
images?

> > Where we have both RTF and HTML, should we perhaps use HTML and pass
> > it through shr, to produce text with faces, rather than raw HTML?
> > Once RTF handler exists, we could use that instead, but having it
> > rendered via HTML might be a useful option anyway.
> 
> What mode could benefit from yanking propertized test?

Any descendant of Text mode can use propertized text.  It doesn't
_have_ to be so, but it's possible, and I think we should offer that
if we can.