Shape.GraphicURL was replaced in 6.1 with Shape.Graphic.OriginURL but when accessed with Python UNO it is empty and Shape.Graphic.Linked is False.
It might be related to:
Steps to Reproduce:
1. install libreoffice 6.1.x and libreoffice-script-provider-python in Ubuntu 18.04:
sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update
sudo apt-get install libreoffice libreoffice-script-provider-python
2. start libreoffice from the command line
3. open the attached ODP in libreoffice
4. open Python3 terminal and try to access shape.Graphic.OriginURL with UNO:
from pythonscript import ScriptContext
localContext = uno.getComponentContext()
resolver = localContext.ServiceManager.createInstanceWithContext(
'com.sun.star.bridge.UnoUrlResolver', localContext )
client = resolver.resolve("uno:pipe,"
XSCRIPTCONTEXT = ScriptContext(client, None, None)
doc = XSCRIPTCONTEXT.getDocument()
slide = doc.DrawPages.getByIndex(0)
shape = slide
shape.Graphic.OriginURL is an empty string
shape.Graphic.Linked is False
shape.Graphic.OriginURL should give us the PNG URL.
shape.Graphic.Linked should be True
User Profile Reset: No
Build ID: 1:6.1.1~rc2-0ubuntu0.18.04.1~lo3
CPU threads: 1; OS: Linux 4.15; UI render: default; VCL: gtk3;
Locale: en-US (en_IL); Calc: group threaded
Created attachment 144904 [details]
ODP with a graphic shape
Tomaz: thought you might be interested in this one since it may concern graphic refactoring.
If I'm wrong, don't hesitate to uncc yourself and sorry for the noise.
Shape.GraphicURL is replaced by Shape.Graphic.OriginURL only if the graphic is linked (that's why the switch Shape.Graphic.Linked).
In the document you provided the graphic is embedded so it is expected that Shape.Graphic.Linked is false and Shape.Graphic.OriginURL is empty.
How can I get the name of the embedded image of the shape?
In the attached ODP it's
Currently you can't.. why do you need that name?
I need access to the image file of the shape to work around animated gif/png bugs in imported PPTX , .
The image data in Shape.Graphic won't help because it's already missing the animation.
OK I see, but your use-case is just working around bugs in LO. So instead of extending the interface for a use case that normal users don't really care about I find it much more sensible and easier to fix this 2 bugs.
The bugs are open since 2015.
This is just one example how the previous GraphicURL API gave us more tools compared to the new API.
I might be able to unzip the ODP and find the image name of graphic shapes but I find it limiting that such an important information can't be accessed with the UNO API.
In addition, I couldn't find a way to access the original and final image data of the Graphic. It has DIB and MaskDIB but I couldn't find info about them in the docs.
Let's move it to NEW and make it to depen on both bugs