Kodi Community Forum
Help displaying image with GUI.ShowNotification - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174)
+---- Thread: Help displaying image with GUI.ShowNotification (/showthread.php?tid=362218)



Help displaying image with GUI.ShowNotification - teriyaki - 2021-04-23

I'm trying to display a local image file (/test/hdr10.png) and if I've read correctly, using the GUI.ShowNotification method is what to use. The exactly call I'm using is:
Quote:curl -s -X POST -H "content-type:application/json" "http://test:test@localhost:8080/jsonrpc" -d '{ "jsonrpc": "2.0", "id": "1", "method": "GUI.ShowNotification", "params": { "title":"test title", "message":"test message", "image":"image://test//hdr10.png", "displaytime":5000 } }'
It's not working however and the logfile shows:
Code:
ERROR <general>: DoWork - Direct texture file loading failed for test
DEBUG <general>: GetImageHash - unable to stat url test

The image /test/hdr10.png is:
Code:
Format                                   : PNG
Format/Info                              : Portable Network Graphic
Format_Compression                       : Deflate
Width                                    : 256 pixels
Height                                   : 256 pixels
Color space                              : RGBA
Bit depth                                : 8 bits
Compression mode                         : Lossless
Stream size                              : 77.6 KiB (100%)

Anyone know what I'm doing wrong here? Also, where is the image displayed? Does it just replace the little info/warning/error icons on either side of the message?


RE: Help displaying image with GUI.ShowNotification - sualfred - 2021-04-23

Yes, it does only replace the icon.

Use the builtin ShowPicture(picture) command.


RE: Help displaying image with GUI.ShowNotification - teriyaki - 2021-04-23

(2021-04-23, 12:01)sualfred Wrote: Yes, it does only replace the icon.

Use the builtin ShowPicture(picture) command.

Thanks for your suggestion. I don't only want to display the image however, I also want a message included and want the whole thing to have a short timelimit. Do you know what I have wrong in the rpc call from my original post?


RE: Help displaying image with GUI.ShowNotification - Montellese - 2021-05-06

I have no idea if you can actually just load a local image but if it is supported your path is wrong: image://test//hdr10.png resolves to test//hdr10.png which is a relative path. What you want would be image:///test/hdr10.png. But again I have no idea if this is supported by the image:// handler.


RE: Help displaying image with GUI.ShowNotification - kavchjoe - 2023-02-28

the field name "image" is mislead - the JSON-RPC API/v10 states the image is actually an enum to show an icon of the following types: info, warning, error

See schema: https://kodi.wiki/view/JSON-RPC_API/v10#GUI.ShowNotification