https://bugs.freedesktop.org/show_bug.cgi?id=72036

          Priority: medium
            Bug ID: 72036
          Assignee: libreoffice-bugs@lists.freedesktop.org
           Summary: GraphicExportFilter mangles asian characters in
                    headless mode
          Severity: normal
    Classification: Unclassified
                OS: Linux (All)
          Reporter: lacrima.ma...@gmail.com
          Hardware: x86-64 (AMD64)
            Status: UNCONFIRMED
           Version: unspecified
         Component: filters and storage
           Product: LibreOffice

Created attachment 89838
  --> https://bugs.freedesktop.org/attachment.cgi?id=89838&action=edit
Python script

Start libreoffice as following:

$ /usr/bin/libreoffice4.0 "--accept=socket,host=localhost,port=2002;urp;"

draw.odg contains some asian text. Let's export it using using
GraphicExportFilter. I created a sample python script for this (drawpages.py):

$ cp draw.odg /tmp/
$ python drawpages.py

Now open /tmp/draw.png. Everything is displayed correctly.

Now start libreoffice in headless mode:

/usr/bin/libreoffice4.0 "--accept=socket,host=localhost,port=2002;urp;"
--headless

Repeat steps above. If you open /tmp/draw.png, you will notice that all asian
characters are mangled.

For convenience I attached drawpages.py and other documents. For clarity here
it is:
--------------------------
import uno

localContext = uno.getComponentContext()
resolver = localContext.ServiceManager.createInstanceWithContext(
        "com.sun.star.bridge.UnoUrlResolver", localContext)

context = resolver.resolve("uno:socket,host=localhost,port=2002;"
                "urp;StarOffice.ComponentContext")

desktop = context.ServiceManager.createInstanceWithContext(
        "com.sun.star.frame.Desktop", context)

url = uno.systemPathToFileUrl('/tmp/draw.odg')
doc = desktop.loadComponentFromURL(url, "_blank", 0, ())

draw_pages = doc.getDrawPages()
page = draw_pages.getByIndex(0)

gf = context.ServiceManager.createInstanceWithContext(
        "com.sun.star.drawing.GraphicExportFilter", context)
gf.setSourceDocument(page)

url = uno.systemPathToFileUrl('/tmp/draw.png')
pv1 = uno.createUnoStruct("com.sun.star.beans.PropertyValue")
pv1.Name, pv1.Value = "URL", url

pv2 = uno.createUnoStruct("com.sun.star.beans.PropertyValue")
pv2.Name, pv2.Value = "MediaType", "image/png"

args = (pv1, pv2)

gf.filter(args)
--------------------------

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to