Created attachment 141890 [details] doc with macro's inserting and changing images Due to API-CHANGE - dropping vnd.sun.star.GraphicObject string properties there is lost a lot of critical functionalities. - As we not can "get" the GraphicURL how can we find out the URL where a image is linked to? - How can we know when a image is "linked" or "embeded" ? we uses in the past: if left(oCheckgraphic1.GraphicURL,27) <> "vnd.sun.star.GraphicObject:" then - As we not can "set" the GraphicURL Inserting its no longer possible to insert a "linked" image or change a linked image.(find a use case in the attached document)
Tomaž Vajngerl committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=8484e52675052848d2d3ffe07378ce2ad29fd288 tdf#117427 missing API for determining and loading linked graphic It will be available in 6.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Tomaz, Thanks for this, i will test as soon your work is present in the current master. Can you also make it possible to query (using the descriptor) for the "DPI" stored in the ImageHeader
Created attachment 142098 [details] New macro's using "LoadAsLink"
Tomaz i tested with the Windows master from 13/05/2018 "LoadAsLink" is not working properly function getGraphFromUrlAsLink(sFileUrl as String ) as Object oProvider = createUnoService("com.sun.star.graphic.GraphicProvider") Dim oPropsIN(1)as new com.sun.star.beans.PropertyValue oPropsIN(0).Name = "URL" oPropsIN(0).Value = converttoURL(sFileUrl) oPropsIN(1).Name = "LoadAsLink" oPropsIN(1).Value = TRUE getGraphFromUrlAsLink = oProvider.queryGraphic(oPropsIN()) end function "Linked" and "OriginURL" returns empty values oProvider = createUnoService("com.sun.star.graphic.GraphicProvider") Dim oPropsDESC(0)as new com.sun.star.beans.PropertyValue oPropsDESC(0).Name = "URL" oPropsDESC(0).Value = converttoURL("http://pmg.pmgroup.be/enews/deroulard/exploit1.jpg") odesc = oProvider.queryGraphicdescriptor(oPropsDESC()) 'xray odesc >> results in Linked boolean False read-only 'OriginURL string "" read-only please use the latest attached writer doc to check my macro's
Isn't it because you called getgraphfromurl and not getgraphfromurlAsLink (line 39)?
Actually, you don't need to do any queryGraphicDescriptor stuff (that is to get the meta-data of the graphic without loading). You just do: ographic = getgraphfromurlaslink(converttoURL("http://pmg.pmgroup.be/enews/deroulard/exploit1.jpg") ) ographic.OriginURL ographic.Linked That works fine for me..
Tomaz, Sorry my stupid mistake a was misslead by the UI properties who not shows the OriginURL in the "LINKfield". It works indeed BUT as i sayed the OriginURL is not visible as "LINK" in the image UI properties. Maybe my line 130 is faulty and i need to replace the Graphic in a other way to make the OriginURL visible in the UI properties ? oGraphic01.graphic = getgraphfromurlAsLink(converttoURL("http://pmg.pmgroup.be/enews/deroulard/exploit1.jpg") ) Do you mean that "queryGraphicDescriptor" is a waste off time and we must forget this quering without loading BTW: this querying is no longer possible because there we need also a "URL" to do the query. Grtz
queryGraphicDescriptor is useful when you want to know some meta-data about the image without the need to load it (or it will load it anyway in some cases). Otherwise XGraphic already has the properties so you don't need to call queryGraphicDescriptor. I'll try to see what the problem is with setting oGraphic01.graphic...
Tomaz, Can you add a extra property to the Xgrafic: the original DPI meta information ? We have first to check if there is Hmm-data (if the hmm is 0 the there is no DPI stored in the iamge) and then devide the the pixels by the Hmm*25,24 to optain the DPI stored in the meta information. Libreoffice uses this DPI meta information to define the size of a inserted image. A Tool (UI and API) to change this DPI in a individual Image File (stored in the documentà would also been super ! And a tool to make the DPI the same in all image would be more than super ! Grtz.
Tomaž Vajngerl committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=3c6b0eb0f16e4cb6d427a160e8ff766209c49f99 tdf#117427 need to check originURL when ReRead is called It will be available in 6.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Well, this is way out of the scope of this bug.
thanks anyhow