Subject: Re: bug#71909: 30.0.60;

From: Eli Zaretskii <[email-masked]>
Date: Mon, 07 Oct 2024 14:58:28 +0300

> Date: Mon, 7 Oct 2024 12:24:01 +0200
> Cc: [email-masked]
> From: Cecilio Pardo <[email-masked]>
> 
> On 06/10/2024 7:59, Eli Zaretskii wrote:
> 
> > But BITMAP is not PNG, AFAIU.  Moreover, with some images, when I copy
> > them in a Web browser, I see "PNG" in the targets vector reported by
> > gui-get-selection.  So I think we need to understand what exactly we
> > get with each format before we decide on the mapping.
> 
> The standard bitmap formats for the clipboard (CF_BITMAP, CF_DIB, 
> CF_DIBV5) are image data specific to windows, not an image format for 
> saving to file.  We need to convert it to an image format, with a 
> mime/type.  PNG or any other, even multiple ones.

Isn't CF_BITMAP format indicate the data to which we convert images on
Windows in the w32-specific portions of image.c?  Or maybe it's a BMP
data (which we can already display, see w32image.c)?  If so, then
yanking images into an Emacs buffer could simply use the data instead
of converting to PNG, then back to bitmap.

> GIMP on ubuntu for example does this when you copy a section of image:
> 
> [TIMESTAMP TARGETS MULTIPLE SAVE_TARGETS image/png image/bmp image/x-bmp 
> image/x-MS-bmp image/x-icon image/x-ico image/x-win-bitmap 
> image/vnd.microsoft.icon ...]
> 
> On windows it does this:
> 
> [PNG DIB BITMAP DIBV5]
> 
> And the Paint program that comes with Windows 11:
> 
> [DataObject Embed\ Source Native OwnerLink Object\ Descriptor METAFILE 
> DIB PNG image/png Ole\ Private\ Data ENHMETAFILE BITMAP ...]
> 
> I didn't expect the PNG, image/png formats.  I suppose they are the same 
> image as the DIB/BITMAP.

I'd rather expect them to be in PNG format.

> > What about other kinds of media, like audio and video data?  Is that
> > supported, and if so, can we include that in some way?
> 
> In standard formats there is CF_RIFF and CF_WAVE.  Also programas may 
> insert a file format (as they do with PNGS), but I haven't found any 
> example yet. In any case, we can do the same as with images.

If CF_WAVE are the same data as in *.wav files, then we should be able
to invoke play-sound in some way.