https://bz.apache.org/ooo/show_bug.cgi?id=112829

dam...@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dam...@apache.org
             Latest|4.0.1                       |4.2.0-dev
    Confirmation in|                            |

--- Comment #18 from dam...@apache.org ---
If your OS uses X11, the list of clipboard formats currently on the clipboard
can be checked with this command:

$ xclip -selection clipboard -target TARGETS

When a chart is copied, the returned list of clipboard formats is:

---snip---
application/x-openoffice-embed-source-xml;windows_formatname="Star Embed Source
(XML)"
application/x-openoffice-objectdescriptor-xml;windows_formatname="Star Object
Descriptor
(XML)";classname="12DCAE26-281F-416F-a234-c3086127382e";typename="Star Object
Descriptor (XML)";viewaspect="1";width="16000";height="9000";posx="0";posy="0"
application/x-openoffice-gdimetafile;windows_formatname="GDIMetaFile"
application/x-openoffice-emf;windows_formatname="Image EMF"
application/x-openoffice-wmf;windows_formatname="Image WMF"
MULTIPLE
---snip---

which are all internal formats, completely useless to third-party apps like
GIMP.

With LO I get a longer list:

---snip---
application/x-openoffice-embed-source-xml;windows_formatname="Star Embed Source
(XML)"
application/x-openoffice-objectdescriptor-xml;windows_formatname="Star Object
Descriptor
(XML)";classname="12DCAE26-281F-416F-a234-c3086127382e";typename="Star Object
Descriptor (XML)";viewaspect="1";width="16000";height="9000";posx="0";posy="0"
application/x-openoffice-gdimetafile;windows_formatname="GDIMetaFile"
application/x-openoffice-emf;windows_formatname="Image EMF"
application/x-openoffice-wmf;windows_formatname="Image WMF"
application/x-openoffice-bitmap;windows_formatname="Bitmap"
image/png
image/bmp
TARGETS
MULTIPLE
TIMESTAMP
SAVE_TARGETS
---snip---

where image/png or image/bmp are presumably what GIMP imports.

Gnumeric offers by far the longest list:

---snip---
TIMESTAMP
TARGETS
MULTIPLE
SAVE_TARGETS
application/x-gnumeric
application/x-goffice-graph
image/svg
image/svg+xml
image/png
image/avif
image/bmp
image/x-bmp
image/x-MS-bmp
image/x-icon
image/x-ico
image/x-win-bitmap
image/vnd.microsoft.icon
application/ico
image/ico
image/icon
text/ico
image/jpeg
image/jxl
image/tiff
---snip---

So what clipboard formats should we be exporting charts with?
1. Export as raster image formats like image/png and/or image/bmp. Possibly,
but this requires rasterizing vector images before export to the clipboard,
which is lossy.
2. Export as the official MIME types for WMF and EMF (image/wmf and image/emf)
as per https://datatracker.ietf.org/doc/html/rfc7903, which third party
applications should recognize better, unlike our private MIME types
application/x-openoffice-wmf and application/x-openoffice-emf which are a
mystery to all.
3. Export as other vector graphics formats, such as SVG.

Doing this:

$ xclip -selection clipboard -target
'application/x-openoffice-wmf;windows_formatname="Image WMF"' -o >
/tmp/image.wmf

does allow GIMP to open /tmp/image.wmf successfully. However just because GIMP
can open WMF files on disk, doesn't mean it can paste them, trying:

$ xclip -selection clipboard -target 'image/wmf' -in /tmp/image.wmf

still doesn't paste in GIMP, despite pasting the same contents successfully
with xclip. Couldn't paste it in Inkscape either :-(. But I can finally paste
into MyPaint. So it looks like GIMP and Inkscape do not support WMF on the
clipboard, even though they can open them from files on disk.

Putting an SVG image on the clipboard, eg:

$ xclip -selection clipboard -target 'image/svg+xml' -in
/usr/local/share/icons/gnome/scalable/emotes/face-angel-symbolic.svg

does allow GIMP and Inkscape and MyPaint to paste it successfully.

So for maximum interoperability we should export charts in:
- WMF and EMF, using the official MIME types, for some apps like MyPaint.
- SVG, for GIMP, Inkscape, and other apps.

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are on the CC list for the issue.

Reply via email to